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:
Chris Mason
2007-10-25 15:43:18 -04:00
parent 18f16f7ba6
commit 5708b95916
2 changed files with 26 additions and 44 deletions

View File

@@ -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);