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.f...@cn.fujitsu.com>
---
 fs/btrfs/backref.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index a88da72..860f4f2 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -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.
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to