aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2014-08-04 14:37:21 -0400
committerChris Mason <clm@fb.com>2014-09-17 16:38:02 -0400
commitf98de9b9c07485f7e21edfd5b2b20c89d662af3c (patch)
treecf83b225c48c5f3fa32be73c25ad4c20b087d580 /fs/btrfs/tree-log.c
parent79aec2b80db1089f983d60e4a22cb95d8b939844 (diff)
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/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 7b6d1428f033..82db14f5cf87 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -2983,8 +2983,6 @@ static noinline int log_dir_items(struct btrfs_trans_handle *trans,
2983 min_key.type = key_type; 2983 min_key.type = key_type;
2984 min_key.offset = min_offset; 2984 min_key.offset = min_offset;
2985 2985
2986 path->keep_locks = 1;
2987
2988 ret = btrfs_search_forward(root, &min_key, path, trans->transid); 2986 ret = btrfs_search_forward(root, &min_key, path, trans->transid);
2989 2987
2990 /* 2988 /*
@@ -3964,7 +3962,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
3964 err = ret; 3962 err = ret;
3965 goto out_unlock; 3963 goto out_unlock;
3966 } 3964 }
3967 path->keep_locks = 1;
3968 3965
3969 while (1) { 3966 while (1) {
3970 ins_nr = 0; 3967 ins_nr = 0;