summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-25 16:01:30 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit925baeddc5b0764a53f2214a1253251bab0e0324 (patch)
tree0e069bf9cc1c4ecd17c812fd1fb81bf807909ee6 /fs/btrfs/ioctl.c
parent1cc127b5d1b71453091859301de4a7dd6ee96fa8 (diff)
downloadlinux-925baeddc5b0764a53f2214a1253251bab0e0324.tar.gz
linux-925baeddc5b0764a53f2214a1253251bab0e0324.tar.bz2
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/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6fb455802759..3fbf74e93dba 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -43,6 +43,7 @@
#include "ioctl.h"
#include "print-tree.h"
#include "volumes.h"
+#include "locking.h"
@@ -75,9 +76,9 @@ static noinline int create_subvol(struct btrfs_root *root, char *name,
if (ret)
goto fail;
- leaf = __btrfs_alloc_free_block(trans, root, root->leafsize,
- objectid, trans->transid, 0, 0,
- 0, 0);
+ leaf = btrfs_alloc_free_block(trans, root, root->leafsize,
+ objectid, trans->transid, 0, 0,
+ 0, 0);
if (IS_ERR(leaf))
return PTR_ERR(leaf);
@@ -108,6 +109,7 @@ static noinline int create_subvol(struct btrfs_root *root, char *name,
memset(&root_item.drop_progress, 0, sizeof(root_item.drop_progress));
root_item.drop_level = 0;
+ btrfs_tree_unlock(leaf);
free_extent_buffer(leaf);
leaf = NULL;