Skip to content

Commit d195779

Browse files
Lu Fengqikdave
authored andcommitted
btrfs: Remove fs_info argument from btrfs_uuid_tree_rem
This function always takes a transaction handle which contains a reference to the fs_info. Use that and remove the extra argument. Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com> Reviewed-by: Nikolay Borisov <nborisov@suse.com> [ rename the function ] Signed-off-by: David Sterba <dsterba@suse.com>
1 parent cdb345a commit d195779

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

fs/btrfs/ctree.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,8 +3042,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
30423042
/* uuid-tree.c */
30433043
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
30443044
u64 subid);
3045-
int btrfs_uuid_tree_rem(struct btrfs_trans_handle *trans,
3046-
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
3045+
int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
30473046
u64 subid);
30483047
int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info,
30493048
int (*check_func)(struct btrfs_fs_info *, u8 *, u8,

fs/btrfs/inode.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4361,7 +4361,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
43614361
}
43624362
}
43634363

4364-
ret = btrfs_uuid_tree_rem(trans, fs_info, dest->root_item.uuid,
4364+
ret = btrfs_uuid_tree_remove(trans, dest->root_item.uuid,
43654365
BTRFS_UUID_KEY_SUBVOL,
43664366
dest->root_key.objectid);
43674367
if (ret && ret != -ENOENT) {
@@ -4370,7 +4370,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
43704370
goto out_end_trans;
43714371
}
43724372
if (!btrfs_is_empty_uuid(dest->root_item.received_uuid)) {
4373-
ret = btrfs_uuid_tree_rem(trans, fs_info,
4373+
ret = btrfs_uuid_tree_remove(trans,
43744374
dest->root_item.received_uuid,
43754375
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
43764376
dest->root_key.objectid);

fs/btrfs/ioctl.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5018,8 +5018,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
50185018
BTRFS_UUID_SIZE);
50195019
if (received_uuid_changed &&
50205020
!btrfs_is_empty_uuid(root_item->received_uuid)) {
5021-
ret = btrfs_uuid_tree_rem(trans, fs_info,
5022-
root_item->received_uuid,
5021+
ret = btrfs_uuid_tree_remove(trans, root_item->received_uuid,
50235022
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
50245023
root->root_key.objectid);
50255024
if (ret && ret != -ENOENT) {

fs/btrfs/uuid-tree.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,10 @@ int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
144144
return ret;
145145
}
146146

147-
int btrfs_uuid_tree_rem(struct btrfs_trans_handle *trans,
148-
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
147+
int btrfs_uuid_tree_remove(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
149148
u64 subid)
150149
{
150+
struct btrfs_fs_info *fs_info = trans->fs_info;
151151
struct btrfs_root *uuid_root = fs_info->uuid_root;
152152
int ret;
153153
struct btrfs_path *path = NULL;
@@ -239,7 +239,7 @@ static int btrfs_uuid_iter_rem(struct btrfs_root *uuid_root, u8 *uuid, u8 type,
239239
goto out;
240240
}
241241

242-
ret = btrfs_uuid_tree_rem(trans, uuid_root->fs_info, uuid, type, subid);
242+
ret = btrfs_uuid_tree_remove(trans, uuid, type, subid);
243243
btrfs_end_transaction(trans);
244244

245245
out:

0 commit comments

Comments
 (0)