diff options
author | Ilya Dryomov <idryomov@gmail.com> | 2012-01-16 15:04:48 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2012-01-16 15:04:48 -0500 |
commit | 9555c6c180600b40f6e86bd4dc53bf47e06ed663 (patch) | |
tree | 74f95edee2368e183a2a054c24725d2940632a8f /fs/btrfs/volumes.c | |
parent | 596410151ed71819b9e8a8018c6c9992796b256d (diff) |
Btrfs: add skip_balance mount option
Since restriper kthread starts involuntarily on mount and can suck cpu
and memory bandwidth add a mount option to forcefully skip it. The
restriper in that case hangs around in paused state and can be resumed
from userspace when it's convenient.
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/btrfs/volumes.c')
-rw-r--r-- | fs/btrfs/volumes.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 17e565388de0..e0160607e6e2 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -2707,15 +2707,19 @@ static int balance_kthread(void *data) | |||
2707 | struct btrfs_balance_control *bctl = | 2707 | struct btrfs_balance_control *bctl = |
2708 | (struct btrfs_balance_control *)data; | 2708 | (struct btrfs_balance_control *)data; |
2709 | struct btrfs_fs_info *fs_info = bctl->fs_info; | 2709 | struct btrfs_fs_info *fs_info = bctl->fs_info; |
2710 | int ret; | 2710 | int ret = 0; |
2711 | 2711 | ||
2712 | mutex_lock(&fs_info->volume_mutex); | 2712 | mutex_lock(&fs_info->volume_mutex); |
2713 | mutex_lock(&fs_info->balance_mutex); | 2713 | mutex_lock(&fs_info->balance_mutex); |
2714 | 2714 | ||
2715 | set_balance_control(bctl); | 2715 | set_balance_control(bctl); |
2716 | 2716 | ||
2717 | printk(KERN_INFO "btrfs: continuing balance\n"); | 2717 | if (btrfs_test_opt(fs_info->tree_root, SKIP_BALANCE)) { |
2718 | ret = btrfs_balance(bctl, NULL); | 2718 | printk(KERN_INFO "btrfs: force skipping balance\n"); |
2719 | } else { | ||
2720 | printk(KERN_INFO "btrfs: continuing balance\n"); | ||
2721 | ret = btrfs_balance(bctl, NULL); | ||
2722 | } | ||
2719 | 2723 | ||
2720 | mutex_unlock(&fs_info->balance_mutex); | 2724 | mutex_unlock(&fs_info->balance_mutex); |
2721 | mutex_unlock(&fs_info->volume_mutex); | 2725 | mutex_unlock(&fs_info->volume_mutex); |