btrfs: introduce btrfs_try_lock_balance
authorNikolay Borisov <nborisov@suse.com>
Tue, 3 May 2022 08:36:36 +0000 (11:36 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Jul 2022 15:44:34 +0000 (17:44 +0200)
commit7fb10ed89e95e26f5f81087a75f2a4bfa43b1705
tree660e9c1d0ebba1bc9e10275c0cfd2cf01ca540f8
parent1e87770cb35c0757ef72939c0e83a03de3f8fdc7
btrfs: introduce btrfs_try_lock_balance

This function contains the factored out locking sequence of
btrfs_ioctl_balance. Having this piece of code separate helps to
simplify btrfs_ioctl_balance which has too complicated.  This will be
used in the next patch to streamline the logic in btrfs_ioctl_balance.

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