Skip to content

Commit

Permalink
Btrfs: allow for selecting only completely empty chunks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ilya Dryomov authored and Josef Bacik committed Feb 20, 2013
1 parent bf023ec commit 3e39cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e39cea

Please sign in to comment.