Commit cdb345a8 authored by Lu Fengqi's avatar Lu Fengqi Committed by David Sterba

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: default avatarLu Fengqi <lufq.fnst@cn.fujitsu.com>
Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent f9ddfd05
...@@ -3040,8 +3040,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans, ...@@ -3040,8 +3040,7 @@ void btrfs_update_root_times(struct btrfs_trans_handle *trans,
struct btrfs_root *root); struct btrfs_root *root);
/* uuid-tree.c */ /* uuid-tree.c */
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
u64 subid); u64 subid);
int btrfs_uuid_tree_rem(struct btrfs_trans_handle *trans, int btrfs_uuid_tree_rem(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type, struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
......
...@@ -718,7 +718,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -718,7 +718,7 @@ static noinline int create_subvol(struct inode *dir,
btrfs_ino(BTRFS_I(dir)), index, name, namelen); btrfs_ino(BTRFS_I(dir)), index, name, namelen);
BUG_ON(ret); BUG_ON(ret);
ret = btrfs_uuid_tree_add(trans, fs_info, root_item->uuid, ret = btrfs_uuid_tree_add(trans, root_item->uuid,
BTRFS_UUID_KEY_SUBVOL, objectid); BTRFS_UUID_KEY_SUBVOL, objectid);
if (ret) if (ret)
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
...@@ -5043,7 +5043,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file, ...@@ -5043,7 +5043,7 @@ static long _btrfs_ioctl_set_received_subvol(struct file *file,
goto out; goto out;
} }
if (received_uuid_changed && !btrfs_is_empty_uuid(sa->uuid)) { if (received_uuid_changed && !btrfs_is_empty_uuid(sa->uuid)) {
ret = btrfs_uuid_tree_add(trans, fs_info, sa->uuid, ret = btrfs_uuid_tree_add(trans, sa->uuid,
BTRFS_UUID_KEY_RECEIVED_SUBVOL, BTRFS_UUID_KEY_RECEIVED_SUBVOL,
root->root_key.objectid); root->root_key.objectid);
if (ret < 0 && ret != -EEXIST) { if (ret < 0 && ret != -EEXIST) {
......
...@@ -1634,15 +1634,14 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ...@@ -1634,15 +1634,14 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto fail; goto fail;
} }
ret = btrfs_uuid_tree_add(trans, fs_info, new_uuid.b, ret = btrfs_uuid_tree_add(trans, new_uuid.b, BTRFS_UUID_KEY_SUBVOL,
BTRFS_UUID_KEY_SUBVOL, objectid); objectid);
if (ret) { if (ret) {
btrfs_abort_transaction(trans, ret); btrfs_abort_transaction(trans, ret);
goto fail; goto fail;
} }
if (!btrfs_is_empty_uuid(new_root_item->received_uuid)) { if (!btrfs_is_empty_uuid(new_root_item->received_uuid)) {
ret = btrfs_uuid_tree_add(trans, fs_info, ret = btrfs_uuid_tree_add(trans, new_root_item->received_uuid,
new_root_item->received_uuid,
BTRFS_UUID_KEY_RECEIVED_SUBVOL, BTRFS_UUID_KEY_RECEIVED_SUBVOL,
objectid); objectid);
if (ret && ret != -EEXIST) { if (ret && ret != -EEXIST) {
......
...@@ -79,10 +79,10 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, u8 *uuid, ...@@ -79,10 +79,10 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, u8 *uuid,
return ret; return ret;
} }
int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, int btrfs_uuid_tree_add(struct btrfs_trans_handle *trans, u8 *uuid, u8 type,
struct btrfs_fs_info *fs_info, u8 *uuid, u8 type,
u64 subid_cpu) u64 subid_cpu)
{ {
struct btrfs_fs_info *fs_info = trans->fs_info;
struct btrfs_root *uuid_root = fs_info->uuid_root; struct btrfs_root *uuid_root = fs_info->uuid_root;
int ret; int ret;
struct btrfs_path *path = NULL; struct btrfs_path *path = NULL;
......
...@@ -4209,8 +4209,7 @@ static int btrfs_uuid_scan_kthread(void *data) ...@@ -4209,8 +4209,7 @@ static int btrfs_uuid_scan_kthread(void *data)
} }
update_tree: update_tree:
if (!btrfs_is_empty_uuid(root_item.uuid)) { if (!btrfs_is_empty_uuid(root_item.uuid)) {
ret = btrfs_uuid_tree_add(trans, fs_info, ret = btrfs_uuid_tree_add(trans, root_item.uuid,
root_item.uuid,
BTRFS_UUID_KEY_SUBVOL, BTRFS_UUID_KEY_SUBVOL,
key.objectid); key.objectid);
if (ret < 0) { if (ret < 0) {
...@@ -4221,7 +4220,7 @@ static int btrfs_uuid_scan_kthread(void *data) ...@@ -4221,7 +4220,7 @@ static int btrfs_uuid_scan_kthread(void *data)
} }
if (!btrfs_is_empty_uuid(root_item.received_uuid)) { if (!btrfs_is_empty_uuid(root_item.received_uuid)) {
ret = btrfs_uuid_tree_add(trans, fs_info, ret = btrfs_uuid_tree_add(trans,
root_item.received_uuid, root_item.received_uuid,
BTRFS_UUID_KEY_RECEIVED_SUBVOL, BTRFS_UUID_KEY_RECEIVED_SUBVOL,
key.objectid); key.objectid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment