summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-defrag.c
diff options
context:
space:
mode:
authorChris Mason2008-06-25 22:01:30 +0200
committerChris Mason2008-09-25 17:04:03 +0200
commit925baeddc5b0764a53f2214a1253251bab0e0324 (patch)
tree0e069bf9cc1c4ecd17c812fd1fb81bf807909ee6 /fs/btrfs/tree-defrag.c
parentBtrfs: Add a thread pool just for submit_bio (diff)
downloadkernel-qcow2-linux-925baeddc5b0764a53f2214a1253251bab0e0324.tar.gz
kernel-qcow2-linux-925baeddc5b0764a53f2214a1253251bab0e0324.tar.xz
kernel-qcow2-linux-925baeddc5b0764a53f2214a1253251bab0e0324.zip
Btrfs: Start btree concurrency work.
The allocation trees and the chunk trees are serialized via their own dedicated mutexes. This means allocation location is still not very fine grained. The main FS btree is protected by locks on each block in the btree. Locks are taken top / down, and as processing finishes on a given level of the tree, the lock is released after locking the lower level. The end result of a search is now a path where only the lowest level is locked. Releasing or freeing the path drops any locks held. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/tree-defrag.c')
-rw-r--r--fs/btrfs/tree-defrag.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/tree-defrag.c b/fs/btrfs/tree-defrag.c
index 155961c7b4d5..fab851d85383 100644
--- a/fs/btrfs/tree-defrag.c
+++ b/fs/btrfs/tree-defrag.c
@@ -181,6 +181,8 @@ int btrfs_defrag_leaves(struct btrfs_trans_handle *trans,
if (root->fs_info->extent_root == root)
is_extent = 1;
+ goto out;
+
if (root->ref_cows == 0 && !is_extent)
goto out;