62e2749e03
Add (untested and simple) directory item code Fix comp_keys to use the new key ordering Add btrfs_insert_empty_item Signed-off-by: Chris Mason <chris.mason@oracle.com>
23 lines
391 B
C
23 lines
391 B
C
#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;
|
|
}
|