summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorIlya Dryomov <idryomov@gmail.com>2013-02-12 17:28:59 +0100
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 18:59:54 +0100
commit3e39cea61c4ecb5774c08f3e30507fdd58c1cca9 (patch)
tree6f3f4600f5bb0fa8aebf6847bebcd96b0aa7631c /fs/btrfs
parentBtrfs: eliminate a use-after-free in btrfs_balance() (diff)
downloadlinux-3e39cea61c4ecb5774c08f3e30507fdd58c1cca9.tar.xz
linux-3e39cea61c4ecb5774c08f3e30507fdd58c1cca9.zip
Btrfs: allow for selecting only completely empty chunks
Enhance balance usage filter by making it possible to balance out only completely empty chunks. Today, usage filter properly acts on values from 1 to 99 inclusive, usage=100 selects all chunks, and usage=0 selects no chunks. This commit changes the usage=0 case: the new meaning is to restripe only completely empty chunks and nothing else. Suggested-by: David Sterba <dsterba@suse.cz> Signed-off-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/volumes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index d778e9666597..567076542d1d 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -2679,7 +2679,7 @@ static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset,
chunk_used = btrfs_block_group_used(&cache->item);
if (bargs->usage == 0)
- user_thresh = 0;
+ user_thresh = 1;
else if (bargs->usage > 100)
user_thresh = cache->key.offset;
else