aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/hash.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-22 12:13:20 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-22 12:13:20 -0400
commite20d96d64f9cf9288ffecc9ad4714e91c3b97ca8 (patch)
treefbe07d48bc7997226075169118ffa2a2e63f5d51 /fs/btrfs/hash.c
parent2e635a278354a1a7951e16cfea4c247d6d0e7c99 (diff)
Mountable btrfs, with readdir
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/hash.c')
-rw-r--r--fs/btrfs/hash.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c
index 6c2a71a46c7d..22519b8e0cf2 100644
--- a/fs/btrfs/hash.c
+++ b/fs/btrfs/hash.c
@@ -10,6 +10,7 @@
10 * License. 10 * License.
11 */ 11 */
12 12
13#include <linux/types.h>
13#define DELTA 0x9E3779B9 14#define DELTA 0x9E3779B9
14 15
15static void TEA_transform(__u32 buf[2], __u32 const in[]) 16static void TEA_transform(__u32 buf[2], __u32 const in[])
@@ -63,6 +64,14 @@ int btrfs_name_hash(const char *name, int len, u64 *hash_result)
63 const char *p; 64 const char *p;
64 __u32 in[8], buf[2]; 65 __u32 in[8], buf[2];
65 66
67 if (len == 1 && *name == '.') {
68 *hash_result = 1;
69 return 0;
70 } else if (len == 2 && name[0] == '.' && name[1] == '.') {
71 *hash_result = 2;
72 return 0;
73 }
74
66 /* Initialize the default seed for the hash checksum functions */ 75 /* Initialize the default seed for the hash checksum functions */
67 buf[0] = 0x67452301; 76 buf[0] = 0x67452301;
68 buf[1] = 0xefcdab89; 77 buf[1] = 0xefcdab89;