diff options
Diffstat (limited to 'fs/btrfs/hash.h')
| -rw-r--r-- | fs/btrfs/hash.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/fs/btrfs/hash.h b/fs/btrfs/hash.h index db2ff9773b9..118a2316e5d 100644 --- a/fs/btrfs/hash.h +++ b/fs/btrfs/hash.h @@ -19,9 +19,24 @@ #ifndef __HASH__ #define __HASH__ -#include <linux/crc32c.h> +int __init btrfs_hash_init(void); + +void btrfs_hash_exit(void); + +u32 btrfs_crc32c(u32 crc, const void *address, unsigned int length); + static inline u64 btrfs_name_hash(const char *name, int len) { - return crc32c((u32)~1, name, len); + return btrfs_crc32c((u32)~1, name, len); } + +/* + * Figure the key offset of an extended inode ref + */ +static inline u64 btrfs_extref_hash(u64 parent_objectid, const char *name, + int len) +{ + return (u64) btrfs_crc32c(parent_objectid, name, len); +} + #endif |
