diff options
author | David Sterba <dsterba@suse.com> | 2018-05-07 11:44:03 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-05-28 12:07:30 -0400 |
commit | 6fcf6e2bffb6cfe26f05795f4fba4e6bb6aa84bf (patch) | |
tree | fbd966ec61b0201799eca513bcc64a81fb6f3309 | |
parent | c9f6f3cd1c6fc4df959ce2bce15e5e6ce660bfd4 (diff) |
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: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r-- | fs/btrfs/ioctl.c | 3 | ||||
-rw-r--r-- | fs/btrfs/volumes.c | 7 | ||||
-rw-r--r-- | fs/btrfs/volumes.h | 5 |
3 files changed, 6 insertions, 9 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index b708f12292b6..48e2ddff32bd 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -4428,7 +4428,6 @@ locked: | |||
4428 | goto out_bargs; | 4428 | goto out_bargs; |
4429 | } | 4429 | } |
4430 | 4430 | ||
4431 | bctl->fs_info = fs_info; | ||
4432 | if (arg) { | 4431 | if (arg) { |
4433 | memcpy(&bctl->data, &bargs->data, sizeof(bctl->data)); | 4432 | memcpy(&bctl->data, &bargs->data, sizeof(bctl->data)); |
4434 | memcpy(&bctl->meta, &bargs->meta, sizeof(bctl->meta)); | 4433 | memcpy(&bctl->meta, &bargs->meta, sizeof(bctl->meta)); |
@@ -4454,7 +4453,7 @@ do_balance: | |||
4454 | */ | 4453 | */ |
4455 | need_unlock = false; | 4454 | need_unlock = false; |
4456 | 4455 | ||
4457 | ret = btrfs_balance(bctl, bargs); | 4456 | ret = btrfs_balance(fs_info, bctl, bargs); |
4458 | bctl = NULL; | 4457 | bctl = NULL; |
4459 | 4458 | ||
4460 | if (arg) { | 4459 | if (arg) { |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 45227c83b742..ebc81766fc86 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -3769,10 +3769,10 @@ static inline int validate_convert_profile(struct btrfs_balance_args *bctl_arg, | |||
3769 | /* | 3769 | /* |
3770 | * Should be called with balance mutexe held | 3770 | * Should be called with balance mutexe held |
3771 | */ | 3771 | */ |
3772 | int btrfs_balance(struct btrfs_balance_control *bctl, | 3772 | int btrfs_balance(struct btrfs_fs_info *fs_info, |
3773 | struct btrfs_balance_control *bctl, | ||
3773 | struct btrfs_ioctl_balance_args *bargs) | 3774 | struct btrfs_ioctl_balance_args *bargs) |
3774 | { | 3775 | { |
3775 | struct btrfs_fs_info *fs_info = bctl->fs_info; | ||
3776 | u64 meta_target, data_target; | 3776 | u64 meta_target, data_target; |
3777 | u64 allowed; | 3777 | u64 allowed; |
3778 | int mixed = 0; | 3778 | int mixed = 0; |
@@ -3940,7 +3940,7 @@ static int balance_kthread(void *data) | |||
3940 | mutex_lock(&fs_info->balance_mutex); | 3940 | mutex_lock(&fs_info->balance_mutex); |
3941 | if (fs_info->balance_ctl) { | 3941 | if (fs_info->balance_ctl) { |
3942 | btrfs_info(fs_info, "continuing balance"); | 3942 | btrfs_info(fs_info, "continuing balance"); |
3943 | ret = btrfs_balance(fs_info->balance_ctl, NULL); | 3943 | ret = btrfs_balance(fs_info, fs_info->balance_ctl, NULL); |
3944 | } | 3944 | } |
3945 | mutex_unlock(&fs_info->balance_mutex); | 3945 | mutex_unlock(&fs_info->balance_mutex); |
3946 | 3946 | ||
@@ -4011,7 +4011,6 @@ int btrfs_recover_balance(struct btrfs_fs_info *fs_info) | |||
4011 | leaf = path->nodes[0]; | 4011 | leaf = path->nodes[0]; |
4012 | item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); | 4012 | item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_balance_item); |
4013 | 4013 | ||
4014 | bctl->fs_info = fs_info; | ||
4015 | bctl->flags = btrfs_balance_flags(leaf, item); | 4014 | bctl->flags = btrfs_balance_flags(leaf, item); |
4016 | bctl->flags |= BTRFS_BALANCE_RESUME; | 4015 | bctl->flags |= BTRFS_BALANCE_RESUME; |
4017 | 4016 | ||
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 39787a2f5fb4..5139ec8daf4c 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
@@ -352,8 +352,6 @@ struct map_lookup { | |||
352 | struct btrfs_balance_args; | 352 | struct btrfs_balance_args; |
353 | struct btrfs_balance_progress; | 353 | struct btrfs_balance_progress; |
354 | struct btrfs_balance_control { | 354 | struct btrfs_balance_control { |
355 | struct btrfs_fs_info *fs_info; | ||
356 | |||
357 | struct btrfs_balance_args data; | 355 | struct btrfs_balance_args data; |
358 | struct btrfs_balance_args meta; | 356 | struct btrfs_balance_args meta; |
359 | struct btrfs_balance_args sys; | 357 | struct btrfs_balance_args sys; |
@@ -432,7 +430,8 @@ struct btrfs_device *btrfs_find_device(struct btrfs_fs_info *fs_info, u64 devid, | |||
432 | u8 *uuid, u8 *fsid); | 430 | u8 *uuid, u8 *fsid); |
433 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); | 431 | int btrfs_shrink_device(struct btrfs_device *device, u64 new_size); |
434 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); | 432 | int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *path); |
435 | int btrfs_balance(struct btrfs_balance_control *bctl, | 433 | int btrfs_balance(struct btrfs_fs_info *fs_info, |
434 | struct btrfs_balance_control *bctl, | ||
436 | struct btrfs_ioctl_balance_args *bargs); | 435 | struct btrfs_ioctl_balance_args *bargs); |
437 | int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); | 436 | int btrfs_resume_balance_async(struct btrfs_fs_info *fs_info); |
438 | int btrfs_recover_balance(struct btrfs_fs_info *fs_info); | 437 | int btrfs_recover_balance(struct btrfs_fs_info *fs_info); |