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>
{
return crc32c((u32)~1, name, 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);
+}
+
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
static int find_name_in_backref(struct btrfs_path *path, const char * name,
int name_len, struct btrfs_inode_ref **ref_ret)
static int find_name_in_backref(struct btrfs_path *path, const char * name,
int name_len, struct btrfs_inode_ref **ref_ret)
-static inline u64 btrfs_extref_hash(u64 parent_ino, const char *name,
- int namelen)
-{
- return (u64)btrfs_crc32c(parent_ino, name, namelen);
-}
-
static int btrfs_find_name_in_ext_backref(struct btrfs_path *path,
u64 parent_ino, const char *name, int namelen,
struct btrfs_inode_extref **extref_ret)
static int btrfs_find_name_in_ext_backref(struct btrfs_path *path,
u64 parent_ino, const char *name, int namelen,
struct btrfs_inode_extref **extref_ret)