diff options
author | Filipe Manana <fdmanana@suse.com> | 2014-08-04 22:37:21 +0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-18 00:38:02 +0400 |
commit | f98de9b9c07485f7e21edfd5b2b20c89d662af3c (patch) | |
tree | cf83b225c48c5f3fa32be73c25ad4c20b087d580 /fs/btrfs/uuid-tree.c | |
parent | 79aec2b80db1089f983d60e4a22cb95d8b939844 (diff) | |
download | linux-f98de9b9c07485f7e21edfd5b2b20c89d662af3c.tar.xz |
Btrfs: make btrfs_search_forward return with nodes unlocked
None of the uses of btrfs_search_forward() need to have the path
nodes (level >= 1) read locked, only the leaf needs to be locked
while the caller processes it. Therefore make it return a path
with all nodes unlocked, except for the leaf.
This change is motivated by the observation that during a file
fsync we repeatdly call btrfs_search_forward() and process the
returned leaf while upper nodes of the returned path (level >= 1)
are read locked, which unnecessarily blocks other tasks that want
to write to the same fs/subvol btree.
Therefore instead of modifying the fsync code to unlock all nodes
with level >= 1 immediately after calling btrfs_search_forward(),
change btrfs_search_forward() to do it, so that it benefits all
callers.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/uuid-tree.c')
-rw-r--r-- | fs/btrfs/uuid-tree.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c index f6a4c03ee7d8..778282944530 100644 --- a/fs/btrfs/uuid-tree.c +++ b/fs/btrfs/uuid-tree.c @@ -279,7 +279,6 @@ int btrfs_uuid_tree_iterate(struct btrfs_fs_info *fs_info, key.offset = 0; again_search_slot: - path->keep_locks = 1; ret = btrfs_search_forward(root, &key, path, 0); if (ret) { if (ret > 0) |