Btrfs: Tune the automatic defrag code
1) Forced defrag wasn't working properly (btrfsctl -d) because some cache only checks were incorrect. 2) Defrag only the leaves unless in forced defrag mode. 3) Don't use complex logic to figure out if a leaf is needs defrag Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
@@ -183,7 +183,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
|
||||
if (level == 0) {
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (root->defrag_progress.objectid == 0) {
|
||||
extent_buffer_get(root->node);
|
||||
ret = btrfs_cow_block(trans, root, root->node, NULL, 0, &tmp);
|
||||
|
Reference in New Issue
Block a user