summaryrefslogtreecommitdiff
path: root/hasher.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-15 12:56:47 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-15 12:56:47 -0400
commitda99898c78a5c580ef1cb54fdcbd66cb7d48d429 (patch)
tree900b308ad2abe7abbb13030ff2272c71b849916d /hasher.c
parentc8afca944b9cf606924adf5c0efaef4132f9d8cd (diff)
Use a chunk of the key flags to record the item type.
Add (untested and simple) directory item code Fix comp_keys to use the new key ordering Add btrfs_insert_empty_item
Diffstat (limited to 'hasher.c')
-rw-r--r--hasher.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/hasher.c b/hasher.c
new file mode 100644
index 00000000..96702da4
--- /dev/null
+++ b/hasher.c
@@ -0,0 +1,23 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "kerncompat.h"
+#include "hash.h"
+
+int main() {
+ u64 result;
+ int ret;
+ char line[255];
+ char *p;
+ while(1) {
+ p = fgets(line, 255, stdin);
+ if (!p)
+ break;
+ if (strlen(line) == 0)
+ continue;
+ ret = btrfs_name_hash(line, strlen(line), &result);
+ BUG_ON(ret);
+ printf("hash returns %Lu\n", result);
+ }
+ return 0;
+}