diff options
author | 2021-11-25 11:14:41 +0200 | |
---|---|---|
committer | 2022-01-07 14:18:23 +0100 | |
commit | efc0e69c2feab8efcdbb9efdb9aae892d11b1545 (patch) | |
tree | 3a2450687319c4d9f7775dc48f40ba500ad91282 /fs/btrfs/ctree.h | |
parent | btrfs: make send work with concurrent block group relocation (diff) | |
download | linux-efc0e69c2feab8efcdbb9efdb9aae892d11b1545.tar.gz linux-efc0e69c2feab8efcdbb9efdb9aae892d11b1545.tar.bz2 linux-efc0e69c2feab8efcdbb9efdb9aae892d11b1545.zip |
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>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 0c92158cb50c..4ea7157ca03c 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -611,6 +611,7 @@ enum { */ enum btrfs_exclusive_operation { BTRFS_EXCLOP_NONE, + BTRFS_EXCLOP_BALANCE_PAUSED, BTRFS_EXCLOP_BALANCE, BTRFS_EXCLOP_DEV_ADD, BTRFS_EXCLOP_DEV_REMOVE, @@ -3321,6 +3322,9 @@ bool btrfs_exclop_start_try_lock(struct btrfs_fs_info *fs_info, enum btrfs_exclusive_operation type); void btrfs_exclop_start_unlock(struct btrfs_fs_info *fs_info); void btrfs_exclop_finish(struct btrfs_fs_info *fs_info); +void btrfs_exclop_balance(struct btrfs_fs_info *fs_info, + enum btrfs_exclusive_operation op); + /* file.c */ int __init btrfs_auto_defrag_init(void); |