summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2014-02-13 11:19:47 +0800
committerJiri Slaby <jslaby@suse.cz>2016-04-11 16:43:49 +0200
commita8a83b61ee4585fdae046a98fc1bd20cdb122fc7 (patch)
tree0fdc725a4a2a8e37ba598cc1f6ff46e1912d0f49
parent5f3284939089d34d1a7685ad83aeca797c3896ae (diff)
downloadlwn-a8a83b61ee4585fdae046a98fc1bd20cdb122fc7.tar.gz
lwn-a8a83b61ee4585fdae046a98fc1bd20cdb122fc7.zip
Btrfs: skip locking when searching commit root
commit e84752d434b5cca0869e906e7b94d0531b25c6d3 upstream. We won't change commit root, skip locking dance with commit root when walking backrefs, this can speed up btrfs send operations. Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fb.com> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--fs/btrfs/backref.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 5859a05f3a76..b7f40f2630f4 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -842,8 +842,10 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
- if (!trans)
+ if (!trans) {
path->search_commit_root = 1;
+ path->skip_locking = 1;
+ }
/*
* grab both a lock on the path and a lock on the delayed ref head.