Skip to content

Commit

Permalink
Switch btrfs_name_hash() to crc32c
Browse files Browse the repository at this point in the history
Date: Tue, 19 Aug 2008 19:21:57 +0100
Using a 64-bit hash as the readdir cookie is just asking for trouble.
And gets it, when we try to export the file system by NFS.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
David Woodhouse authored and Chris Mason committed Sep 25, 2008
1 parent 76fcef1 commit 615f996
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 114 deletions.
2 changes: 1 addition & 1 deletion fs/btrfs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ifneq ($(KERNELRELEASE),)

obj-m := btrfs.o
btrfs-y := super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
hash.o file-item.o inode-item.o inode-map.o disk-io.o \
file-item.o inode-item.o inode-map.o disk-io.o \
transaction.o bit-radix.o inode.o file.o tree-defrag.o \
extent_map.o sysfs.o struct-funcs.o xattr.o ordered-data.o \
extent_io.o volumes.o async-thread.o ioctl.o locking.o orphan.o \
Expand Down
112 changes: 0 additions & 112 deletions fs/btrfs/hash.c

This file was deleted.

7 changes: 6 additions & 1 deletion fs/btrfs/hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,10 @@

#ifndef __HASH__
#define __HASH__
u64 btrfs_name_hash(const char *name, int len);

#include "crc32c.h"
static inline u64 btrfs_name_hash(const char *name, int len)
{
return btrfs_crc32c((u32)~1, name, len);
}
#endif

0 comments on commit 615f996

Please sign in to comment.