]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: simplify code flow in btrfs_ioctl_balance
authorNikolay Borisov <nborisov@suse.com>
Wed, 30 Mar 2022 09:14:07 +0000 (12:14 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 16 May 2022 15:03:10 +0000 (17:03 +0200)
commit299af5175906ab9f70e523b81a1076fb847955d3
tree09befdbaf7886c595ac3b9b658d7c34cd50886a7
parente64fc1bde6c73966a5a1a9a96c8ac788b1886f65
btrfs: simplify code flow in btrfs_ioctl_balance

Move code in btrfs_ioctl_balance to simplify its flow. This is
possible thanks to the removal of balance v1 ioctl and ensuring 'arg'
argument is always present. First move the code duplicating the
userspace arg to the kernel 'barg'. This makes the out_unlock label
redundant.  Secondly, check the validity of bargs::flags before copying
to the dynamically allocated 'bctl'. This removes the need for the
out_bctl label.

Reviewed-by: Sweet Tea Dorminy <sweettea-kernel@dorminy.me>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c