提交 3e39cea6 编写于 作者: I Ilya Dryomov 提交者: Josef Bacik

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: NDavid Sterba <dsterba@suse.cz>
Signed-off-by: NIlya Dryomov <idryomov@gmail.com>
Signed-off-by: NJosef Bacik <jbacik@fusionio.com>
上级 bf023ecf
...@@ -2679,7 +2679,7 @@ static int chunk_usage_filter(struct btrfs_fs_info *fs_info, u64 chunk_offset, ...@@ -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); chunk_used = btrfs_block_group_used(&cache->item);
if (bargs->usage == 0) if (bargs->usage == 0)
user_thresh = 0; user_thresh = 1;
else if (bargs->usage > 100) else if (bargs->usage > 100)
user_thresh = cache->key.offset; user_thresh = cache->key.offset;
else else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册