summaryrefslogtreecommitdiff
path: root/hash.h
diff options
context:
space:
mode:
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>2016-07-15 11:00:28 +0800
committerDavid Sterba <dsterba@suse.com>2016-10-25 14:28:36 +0200
commit36d02f3eb807e86c3b06ad78a9c99ddef2021076 (patch)
tree6037f4e822baa294a2f9cfcc5cc91f52b1c6ca49 /hash.h
parent876db7f50c0658f9c2946a341ad270f3968a28fc (diff)
btrfs-progs: move btrfs_extref_hash() to hash.h
Move btrfs_extref_hash() from inode-item.c to hash.h, so that the function can be called elsewhere. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Diffstat (limited to 'hash.h')
-rw-r--r--hash.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/hash.h b/hash.h
index ac4c4117..9ff67613 100644
--- a/hash.h
+++ b/hash.h
@@ -25,4 +25,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)btrfs_crc32c(parent_objectid, name, len);
+}
+
#endif