diff options
author | Chris Mason <chris.mason@oracle.com> | 2008-06-25 16:01:30 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:04:03 -0400 |
commit | 925baeddc5b0764a53f2214a1253251bab0e0324 (patch) | |
tree | 0e069bf9cc1c4ecd17c812fd1fb81bf807909ee6 /fs/btrfs/ioctl.c | |
parent | 1cc127b5d1b71453091859301de4a7dd6ee96fa8 (diff) |
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.c | 8 |
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 @@ | |||
43 | #include "ioctl.h" | 43 | #include "ioctl.h" |
44 | #include "print-tree.h" | 44 | #include "print-tree.h" |
45 | #include "volumes.h" | 45 | #include "volumes.h" |
46 | #include "locking.h" | ||
46 | 47 | ||
47 | 48 | ||
48 | 49 | ||
@@ -75,9 +76,9 @@ static noinline int create_subvol(struct btrfs_root *root, char *name, | |||
75 | if (ret) | 76 | if (ret) |
76 | goto fail; | 77 | goto fail; |
77 | 78 | ||
78 | leaf = __btrfs_alloc_free_block(trans, root, root->leafsize, | 79 | leaf = btrfs_alloc_free_block(trans, root, root->leafsize, |
79 | objectid, trans->transid, 0, 0, | 80 | objectid, trans->transid, 0, 0, |
80 | 0, 0); | 81 | 0, 0); |
81 | if (IS_ERR(leaf)) | 82 | if (IS_ERR(leaf)) |
82 | return PTR_ERR(leaf); | 83 | return PTR_ERR(leaf); |
83 | 84 | ||
@@ -108,6 +109,7 @@ static noinline int create_subvol(struct btrfs_root *root, char *name, | |||
108 | memset(&root_item.drop_progress, 0, sizeof(root_item.drop_progress)); | 109 | memset(&root_item.drop_progress, 0, sizeof(root_item.drop_progress)); |
109 | root_item.drop_level = 0; | 110 | root_item.drop_level = 0; |
110 | 111 | ||
112 | btrfs_tree_unlock(leaf); | ||
111 | free_extent_buffer(leaf); | 113 | free_extent_buffer(leaf); |
112 | leaf = NULL; | 114 | leaf = NULL; |
113 | 115 | ||