aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/hasher.c
blob: 96702da4329c1ec0831d049c07cd5cdf5c4c5561 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}