Skip to content

Commit cdb345a

Browse files
Lu Fengqikdave
authored andcommitted
btrfs: Remove fs_info argument from btrfs_uuid_tree_add
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> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent f9ddfd0 commit cdb345a

File tree

5 files changed

+10
-13
lines changed

5 files changed

+10
-13
lines changed

fs/btrfs/ctree.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,8 +3040,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
30403040
struct btrfs_root *root);
30413041

30423042
/* uuid-tree.c */
3043-
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans,
3044-
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
3043+
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
30453044
u64 subid);
30463045
int btrfs_uuid_tree_rem(struct btrfs_trans_handle *trans,
30473046
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,

fs/btrfs/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ static noinline int create_subvol(struct inode *dir,
718718
btrfs_ino(BTRFS_I(dir)), index, name, namelen);
719719
BUG_ON(ret);
720720

721-
ret = btrfs_uuid_tree_add(trans, fs_info, root_item->uuid,
721+
ret = btrfs_uuid_tree_add(trans, root_item->uuid,
722722
BTRFS_UUID_KEY_SUBVOL, objectid);
723723
if (ret)
724724
btrfs_abort_transaction(trans, ret);
@@ -5043,7 +5043,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
50435043
goto out;
50445044
}
50455045
if (received_uuid_changed && !btrfs_is_empty_uuid(sa->uuid)) {
5046-
ret = btrfs_uuid_tree_add(trans, fs_info, sa->uuid,
5046+
ret = btrfs_uuid_tree_add(trans, sa->uuid,
50475047
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
50485048
root->root_key.objectid);
50495049
if (ret < 0 && ret != -EEXIST) {

fs/btrfs/transaction.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1634,15 +1634,14 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
16341634
btrfs_abort_transaction(trans, ret);
16351635
goto fail;
16361636
}
1637-
ret = btrfs_uuid_tree_add(trans, fs_info, new_uuid.b,
1638-
BTRFS_UUID_KEY_SUBVOL, objectid);
1637+
ret = btrfs_uuid_tree_add(trans, new_uuid.b, BTRFS_UUID_KEY_SUBVOL,
1638+
objectid);
16391639
if (ret) {
16401640
btrfs_abort_transaction(trans, ret);
16411641
goto fail;
16421642
}
16431643
if (!btrfs_is_empty_uuid(new_root_item->received_uuid)) {
1644-
ret = btrfs_uuid_tree_add(trans, fs_info,
1645-
new_root_item->received_uuid,
1644+
ret = btrfs_uuid_tree_add(trans, new_root_item->received_uuid,
16461645
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
16471646
objectid);
16481647
if (ret && ret != -EEXIST) {

fs/btrfs/uuid-tree.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, u8 *uuid,
7979
return ret;
8080
}
8181

82-
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans,
83-
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
82+
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
8483
u64 subid_cpu)
8584
{
85+
struct btrfs_fs_info *fs_info = trans->fs_info;
8686
struct btrfs_root *uuid_root = fs_info->uuid_root;
8787
int ret;
8888
struct btrfs_path *path = NULL;

fs/btrfs/volumes.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4209,8 +4209,7 @@ static int btrfs_uuid_scan_kthread(void *data)
42094209
}
42104210
update_tree:
42114211
if (!btrfs_is_empty_uuid(root_item.uuid)) {
4212-
ret = btrfs_uuid_tree_add(trans, fs_info,
4213-
root_item.uuid,
4212+
ret = btrfs_uuid_tree_add(trans, root_item.uuid,
42144213
BTRFS_UUID_KEY_SUBVOL,
42154214
key.objectid);
42164215
if (ret < 0) {
@@ -4221,7 +4220,7 @@ static int btrfs_uuid_scan_kthread(void *data)
42214220
}
42224221

42234222
if (!btrfs_is_empty_uuid(root_item.received_uuid)) {
4224-
ret = btrfs_uuid_tree_add(trans, fs_info,
4223+
ret = btrfs_uuid_tree_add(trans,
42254224
root_item.received_uuid,
42264225
BTRFS_UUID_KEY_RECEIVED_SUBVOL,
42274226
key.objectid);

0 commit comments

Comments
 (0)