Skip to content

Commit 8051840

Browse files
Sun YangKaikdave
authored andcommitted
btrfs: remove unused parameters from btrfs_lookup_inode_extref()
The function btrfs_lookup_inode_extref(` no longer requires transaction handle, insert length, or COW flag, as the only caller now performs a read-only lookup using trans == NULL, ins_len == 0 and cow == 0. This function was introduced in the early days where extref feature was introduced by commit f186373 ("btrfs: extended inode refs"). Then some cleanup was done in commit 33b98f2 ("btrfs: cleanup: removed unused 'btrfs_get_inode_ref_index'"), which removed the only caller passing trans and other COW specific options. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Sun YangKai <sunk67188@gmail.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 79b3daf commit 8051840

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

fs/btrfs/inode-item.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,10 @@ struct btrfs_inode_extref *btrfs_find_name_in_ext_backref(
7878
}
7979

8080
/* Returns NULL if no extref found */
81-
struct btrfs_inode_extref *
82-
btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
83-
struct btrfs_root *root,
84-
struct btrfs_path *path,
85-
const struct fscrypt_str *name,
86-
u64 inode_objectid, u64 ref_objectid, int ins_len,
87-
int cow)
81+
struct btrfs_inode_extref *btrfs_lookup_inode_extref(struct btrfs_root *root,
82+
struct btrfs_path *path,
83+
const struct fscrypt_str *name,
84+
u64 inode_objectid, u64 ref_objectid)
8885
{
8986
int ret;
9087
struct btrfs_key key;
@@ -93,7 +90,7 @@ btrfs_lookup_inode_extref(struct btrfs_trans_handle *trans,
9390
key.type = BTRFS_INODE_EXTREF_KEY;
9491
key.offset = btrfs_extref_hash(ref_objectid, name->name, name->len);
9592

96-
ret = btrfs_search_slot(trans, root, &key, path, ins_len, cow);
93+
ret = btrfs_search_slot(NULL, root, &key, path, 0, 0);
9794
if (ret < 0)
9895
return ERR_PTR(ret);
9996
if (ret > 0)

fs/btrfs/inode-item.h

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,10 @@ int btrfs_lookup_inode(struct btrfs_trans_handle *trans,
101101
struct btrfs_root *root, struct btrfs_path *path,
102102
struct btrfs_key *location, int mod);
103103

104-
struct btrfs_inode_extref *btrfs_lookup_inode_extref(
105-
struct btrfs_trans_handle *trans,
106-
struct btrfs_root *root,
107-
struct btrfs_path *path,
108-
const struct fscrypt_str *name,
109-
u64 inode_objectid, u64 ref_objectid, int ins_len,
110-
int cow);
104+
struct btrfs_inode_extref *btrfs_lookup_inode_extref(struct btrfs_root *root,
105+
struct btrfs_path *path,
106+
const struct fscrypt_str *name,
107+
u64 inode_objectid, u64 ref_objectid);
111108

112109
struct btrfs_inode_ref *btrfs_find_name_in_backref(const struct extent_buffer *leaf,
113110
int slot,

fs/btrfs/tree-log.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,9 +1126,7 @@ static inline int __add_inode_ref(struct btrfs_trans_handle *trans,
11261126
btrfs_release_path(path);
11271127

11281128
/* Same search but for extended refs */
1129-
extref = btrfs_lookup_inode_extref(NULL, root, path, name,
1130-
inode_objectid, parent_objectid, 0,
1131-
0);
1129+
extref = btrfs_lookup_inode_extref(root, path, name, inode_objectid, parent_objectid);
11321130
if (IS_ERR(extref)) {
11331131
return PTR_ERR(extref);
11341132
} else if (extref) {

0 commit comments

Comments
 (0)