btrfs: introduce exclusive operation BALANCE_PAUSED state
authorNikolay Borisov <nborisov@suse.com>
Thu, 25 Nov 2021 09:14:41 +0000 (11:14 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 7 Jan 2022 13:18:23 +0000 (14:18 +0100)
commitefc0e69c2feab8efcdbb9efdb9aae892d11b1545
tree3a2450687319c4d9f7775dc48f40ba500ad91282
parentd96b34248c2f4ea8cd09286090f2f6f77102eaab
btrfs: introduce exclusive operation BALANCE_PAUSED state

Current set of exclusive operation states is not sufficient to handle
all practical use cases. In particular there is a need to be able to add
a device to a filesystem that have paused balance. Currently there is no
way to distinguish between a running and a paused balance. Fix this by
introducing BTRFS_EXCLOP_BALANCE_PAUSED which is going to be set in 2
occasions:

1. When a filesystem is mounted with skip_balance and there is an
   unfinished balance it will now be into BALANCE_PAUSED instead of
   simply BALANCE state.

2. When a running balance is paused.

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/ctree.h
fs/btrfs/ioctl.c
fs/btrfs/volumes.c