Commit 6fcf6e2b authored by David Sterba's avatar David Sterba

btrfs: remove redundant btrfs_balance_control::fs_info

The fs_info is always available from the context so we don't need to
store it in the structure.
Reviewed-by: default avatarAnand Jain <anand.jain@oracle.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent c9f6f3cd
...@@ -4428,7 +4428,6 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) ...@@ -4428,7 +4428,6 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
goto out_bargs; goto out_bargs;
} }
bctl->fs_info = fs_info;
if (arg) { if (arg) {
memcpy(&bctl->data, &bargs->data, sizeof(bctl->data)); memcpy(&bctl->data, &bargs->data, sizeof(bctl->data));
memcpy(&bctl->meta, &bargs->meta, sizeof(bctl->meta)); memcpy(&bctl->meta, &bargs->meta, sizeof(bctl->meta));
...@@ -4454,7 +4453,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg) ...@@ -4454,7 +4453,7 @@ static long btrfs_ioctl_balance(struct file *file, void __user *arg)
*/ */
need_unlock = false; need_unlock = false;
ret = btrfs_balance(bctl, bargs); ret = btrfs_balance(fs_info, bctl, bargs);
bctl = NULL; bctl = NULL;
if (arg) { if (arg) {
......
...@@ -3769,10 +3769,10 @@ static inline int validate_convert_profile(struct btrfs_balance_args *bctl_arg, ...@@ -3769,10 +3769,10 @@ static inline int validate_convert_profile(struct btrfs_balance_args *bctl_arg,
/* /*
* Should be called with balance mutexe held * Should be called with balance mutexe held
*/ */
int btrfs_balance(struct btrfs_balance_control *bctl, int btrfs_balance(struct btrfs_fs_info *fs_info,
struct btrfs_balance_control *bctl,
struct btrfs_ioctl_balance_args *bargs) struct btrfs_ioctl_balance_args *bargs)
{ {
struct btrfs_fs_info *fs_info = bctl->fs_info;
u64 meta_target, data_target; u64 meta_target, data_target;
u64 allowed; u64 allowed;
int mixed = 0; int mixed = 0;
...@@ -3940,7 +3940,7 @@ static int balance_kthread(void *data) ...@@ -3940,7 +3940,7 @@ static int balance_kthread(void *data)
mutex_lock(&fs_info->balance_mutex); mutex_lock(&fs_info->balance_mutex);
if (fs_info->balance_ctl) { if (fs_info->balance_ctl) {
btrfs_info(fs_info, "continuing balance"); btrfs_info(fs_info, "continuing balance");
ret = btrfs_balance(fs_info->balance_ctl, NULL); ret = btrfs_balance(fs_info, fs_info->balance_ctl, NULL);
} }
mutex_unlock(&fs_info->balance_mutex); mutex_unlock(&fs_info->balance_mutex);
...@@ -4011,7 +4011,6 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info) ...@@ -4011,7 +4011,6 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info)
leaf = path->nodes[0]; leaf = path->nodes[0];
item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item);
bctl->fs_info = fs_info;
bctl->flags = btrfs_balance_flags(leaf, item); bctl->flags = btrfs_balance_flags(leaf, item);
bctl->flags |= BTRFS_BALANCE_RESUME; bctl->flags |= BTRFS_BALANCE_RESUME;
......
...@@ -352,8 +352,6 @@ struct map_lookup { ...@@ -352,8 +352,6 @@ struct map_lookup {
struct btrfs_balance_args; struct btrfs_balance_args;
struct btrfs_balance_progress; struct btrfs_balance_progress;
struct btrfs_balance_control { struct btrfs_balance_control {
struct btrfs_fs_info *fs_info;
struct btrfs_balance_args data; struct btrfs_balance_args data;
struct btrfs_balance_args meta; struct btrfs_balance_args meta;
struct btrfs_balance_args sys; struct btrfs_balance_args sys;
...@@ -432,7 +430,8 @@ struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, ...@@ -432,7 +430,8 @@ struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid,
u8 *uuid, u8 *fsid); u8 *uuid, u8 *fsid);
int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); int btrfs_shrink_device(struct btrfs_device *device, u64 new_size);
int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path);
int btrfs_balance(struct btrfs_balance_control *bctl, int btrfs_balance(struct btrfs_fs_info *fs_info,
struct btrfs_balance_control *bctl,
struct btrfs_ioctl_balance_args *bargs); struct btrfs_ioctl_balance_args *bargs);
int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info);
int btrfs_recover_balance(struct btrfs_fs_info *fs_info); int btrfs_recover_balance(struct btrfs_fs_info *fs_info);
......
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