X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=inode-item.c;h=1cc106670cd4bfd1ebadb30b6c254b68fee8dd08;hb=1c9c5f7fb3f6a2182d230d469b22b3b1329f24d8;hp=913b81ad3346925440181db1de511d11a4c38871;hpb=890f4a61d7f4563af24617e7b2a5002cb2bf04cf;p=platform%2Fupstream%2Fbtrfs-progs.git diff --git a/inode-item.c b/inode-item.c index 913b81a..1cc1066 100644 --- a/inode-item.c +++ b/inode-item.c @@ -19,7 +19,7 @@ #include "ctree.h" #include "disk-io.h" #include "transaction.h" -#include "crc32c.h" +#include "hash.h" static int find_name_in_backref(struct btrfs_path *path, const char * name, int name_len, struct btrfs_inode_ref **ref_ret) @@ -79,7 +79,7 @@ int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans, goto out; old_size = btrfs_item_size_nr(path->nodes[0], path->slots[0]); - ret = btrfs_extend_item(trans, root, path, ins_len); + ret = btrfs_extend_item(root, path, ins_len); BUG_ON(ret); ref = btrfs_item_ptr(path->nodes[0], path->slots[0], struct btrfs_inode_ref); @@ -106,8 +106,7 @@ out: btrfs_free_path(path); if (ret == -EMLINK) { - if (btrfs_fs_incompat(root->fs_info, - BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)) + if (btrfs_fs_incompat(root->fs_info, EXTENDED_IREF)) ret = btrfs_insert_inode_extref(trans, root, name, name_len, inode_objectid, @@ -161,7 +160,7 @@ int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root struct btrfs_inode_ref *btrfs_lookup_inode_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, const char *name, int namelen, u64 ino, u64 parent_ino, - u64 index, int ins_len) + int ins_len) { struct btrfs_key key; struct btrfs_inode_ref *ret_inode_ref = NULL; @@ -184,12 +183,6 @@ out: return ret_inode_ref; } -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) @@ -319,7 +312,7 @@ int btrfs_del_inode_extref(struct btrfs_trans_handle *trans, memmove_extent_buffer(leaf, ptr, ptr + del_len, item_size - (ptr + del_len - item_start)); - btrfs_truncate_item(trans, root, path, item_size - del_len, 1); + btrfs_truncate_item(root, path, item_size - del_len, 1); out: btrfs_free_path(path); @@ -361,7 +354,7 @@ int btrfs_insert_inode_extref(struct btrfs_trans_handle *trans, name, name_len, NULL)) goto out; - btrfs_extend_item(trans, root, path, ins_len); + btrfs_extend_item(root, path, ins_len); ret = 0; } @@ -440,14 +433,13 @@ int btrfs_del_inode_ref(struct btrfs_trans_handle *trans, item_start = btrfs_item_ptr_offset(leaf, path->slots[0]); memmove_extent_buffer(leaf, ptr, ptr + sub_item_len, item_size - (ptr + sub_item_len - item_start)); - btrfs_truncate_item(trans, root, path, item_size - sub_item_len, 1); + btrfs_truncate_item(root, path, item_size - sub_item_len, 1); btrfs_mark_buffer_dirty(path->nodes[0]); out: btrfs_free_path(path); if (search_ext_refs && - btrfs_fs_incompat(root->fs_info, - BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)) { + btrfs_fs_incompat(root->fs_info, EXTENDED_IREF)) { /* * No refs were found, or we could not find the name in our ref * array. Find and remove the extended inode ref then.