summaryrefslogtreecommitdiff
path: root/fs/btrfs/hash.h
diff options
context:
space:
mode:
authorMark Fasheh <mfasheh@suse.de>2012-08-08 22:32:27 +0400
committerChris Mason <chris.mason@fusionio.com>2012-10-09 17:14:45 +0400
commitf186373fef005cee948a4a39e6a14c2e5f517298 (patch)
tree5683c66a7112e56147149f379658517ab18e7689 /fs/btrfs/hash.h
parent5a1d7843ca4b3a9009bea87f85ad33854b910aea (diff)
downloadlinux-f186373fef005cee948a4a39e6a14c2e5f517298.tar.xz
btrfs: extended inode refs
This patch adds basic support for extended inode refs. This includes support for link and unlink of the refs, which basically gets us support for rename as well. Inode creation does not need changing - extended refs are only added after the ref array is full. Signed-off-by: Mark Fasheh <mfasheh@suse.de>
Diffstat (limited to 'fs/btrfs/hash.h')
-rw-r--r--fs/btrfs/hash.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/hash.h b/fs/btrfs/hash.h
index db2ff9773b99..1d982812ab67 100644
--- a/fs/btrfs/hash.h
+++ b/fs/btrfs/hash.h
@@ -24,4 +24,14 @@ static inline u64 btrfs_name_hash(const char *name, int len)
{
return 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) crc32c(parent_objectid, name, len);
+}
+
#endif