Skip to content

Commit 8c7cd2b

Browse files
committed
btrfs: drop unused parameter fs_info from btrfs_match_dir_item_name()
Cascaded removal of fs_info that is not needed in several functions. Reviewed-by: Anand Jain <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent d12a1a2 commit 8c7cd2b

File tree

4 files changed

+8
-14
lines changed

4 files changed

+8
-14
lines changed

fs/btrfs/dir-item.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ static struct btrfs_dir_item *insert_with_overflow(struct btrfs_trans_handle
2727
const char *name,
2828
int name_len)
2929
{
30-
struct btrfs_fs_info *fs_info = root->fs_info;
3130
int ret;
3231
char *ptr;
3332
struct extent_buffer *leaf;
3433

3534
ret = btrfs_insert_empty_item(trans, root, path, cpu_key, data_size);
3635
if (ret == -EEXIST) {
3736
struct btrfs_dir_item *di;
38-
di = btrfs_match_dir_item_name(fs_info, path, name, name_len);
37+
di = btrfs_match_dir_item_name(path, name, name_len);
3938
if (di)
4039
return ERR_PTR(-EEXIST);
4140
btrfs_extend_item(trans, path, data_size);
@@ -190,7 +189,7 @@ static struct btrfs_dir_item *btrfs_lookup_match_dir(
190189
if (ret > 0)
191190
return ERR_PTR(-ENOENT);
192191

193-
return btrfs_match_dir_item_name(root->fs_info, path, name, name_len);
192+
return btrfs_match_dir_item_name(path, name, name_len);
194193
}
195194

196195
/*
@@ -341,8 +340,7 @@ btrfs_search_dir_index_item(struct btrfs_root *root, struct btrfs_path *path,
341340
if (key.objectid != dirid || key.type != BTRFS_DIR_INDEX_KEY)
342341
break;
343342

344-
di = btrfs_match_dir_item_name(root->fs_info, path,
345-
name->name, name->len);
343+
di = btrfs_match_dir_item_name(path, name->name, name->len);
346344
if (di)
347345
return di;
348346
}
@@ -378,8 +376,7 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans,
378376
* this walks through all the entries in a dir item and finds one
379377
* for a specific name.
380378
*/
381-
struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_fs_info *fs_info,
382-
const struct btrfs_path *path,
379+
struct btrfs_dir_item *btrfs_match_dir_item_name(const struct btrfs_path *path,
383380
const char *name, int name_len)
384381
{
385382
struct btrfs_dir_item *dir_item;

fs/btrfs/dir-item.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans,
4444
struct btrfs_path *path, u64 dir,
4545
const char *name, u16 name_len,
4646
int mod);
47-
struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_fs_info *fs_info,
48-
const struct btrfs_path *path,
47+
struct btrfs_dir_item *btrfs_match_dir_item_name(const struct btrfs_path *path,
4948
const char *name,
5049
int name_len);
5150

fs/btrfs/send.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3760,7 +3760,6 @@ static int wait_for_dest_dir_move(struct send_ctx *sctx,
37603760
struct recorded_ref *parent_ref,
37613761
const bool is_orphan)
37623762
{
3763-
struct btrfs_fs_info *fs_info = sctx->parent_root->fs_info;
37643763
struct btrfs_path *path;
37653764
struct btrfs_key key;
37663765
struct btrfs_key di_key;
@@ -3789,7 +3788,7 @@ static int wait_for_dest_dir_move(struct send_ctx *sctx,
37893788
goto out;
37903789
}
37913790

3792-
di = btrfs_match_dir_item_name(fs_info, path, parent_ref->name,
3791+
di = btrfs_match_dir_item_name(path, parent_ref->name,
37933792
parent_ref->name_len);
37943793
if (!di) {
37953794
ret = 0;

fs/btrfs/xattr.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
8585
{
8686
struct btrfs_dir_item *di = NULL;
8787
struct btrfs_root *root = BTRFS_I(inode)->root;
88-
struct btrfs_fs_info *fs_info = root->fs_info;
8988
struct btrfs_path *path;
9089
size_t name_len = strlen(name);
9190
int ret = 0;
@@ -143,14 +142,14 @@ int btrfs_setxattr(struct btrfs_trans_handle *trans, struct inode *inode,
143142
*/
144143
ret = 0;
145144
btrfs_assert_tree_write_locked(path->nodes[0]);
146-
di = btrfs_match_dir_item_name(fs_info, path, name, name_len);
145+
di = btrfs_match_dir_item_name(path, name, name_len);
147146
if (!di && !(flags & XATTR_REPLACE)) {
148147
ret = -ENOSPC;
149148
goto out;
150149
}
151150
} else if (ret == -EEXIST) {
152151
ret = 0;
153-
di = btrfs_match_dir_item_name(fs_info, path, name, name_len);
152+
di = btrfs_match_dir_item_name(path, name, name_len);
154153
ASSERT(di); /* logic error */
155154
} else if (ret) {
156155
goto out;

0 commit comments

Comments
 (0)