Btrfs: skip locking when searching commit root

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>
This commit is contained in:
Wang Shilong 2014-02-13 11:19:47 +08:00 committed by Josef Bacik
parent 32a447896c
commit e84752d434
1 changed files with 3 additions and 1 deletions

View File

@ -873,8 +873,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.