aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-defrag.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-10-25 15:43:18 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:57 -0400
commit5708b9591617486bf1aa5b1a97f2c0549ec87933 (patch)
treee2d5f219c090ecda4bc9265027b41be2c70a57ad /fs/btrfs/tree-defrag.c
parent18f16f7ba62a01c29e09b40ac6ad6d92a8955859 (diff)
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>
Diffstat (limited to 'fs/btrfs/tree-defrag.c')
-rw-r--r--fs/btrfs/tree-defrag.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c
index b02355a7b143..65ef12351566 100644
--- a/fs/btrfs/tree-defrag.c
+++ b/fs/btrfs/tree-defrag.c
@@ -183,7 +183,6 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
183 if (level == 0) { 183 if (level == 0) {
184 goto out; 184 goto out;
185 } 185 }
186
187 if (root->defrag_progress.objectid == 0) { 186 if (root->defrag_progress.objectid == 0) {
188 extent_buffer_get(root->node); 187 extent_buffer_get(root->node);
189 ret = btrfs_cow_block(trans, root, root->node, NULL, 0, &tmp); 188 ret = btrfs_cow_block(trans, root, root->node, NULL, 0, &tmp);