aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2014-07-28 14:37:17 -0400
committerChris Mason <clm@fb.com>2014-09-17 16:37:56 -0400
commit160f4089c8580b32b5805e7fd8ec7b3810f442c1 (patch)
tree9134be532e8fb6d6875fd62d74ee37605094d8b9 /fs
parent24cdc847d9842bdfd85a005ebc39050bcbc7acba (diff)
Btrfs: avoid unnecessary switch of path locks to blocking mode
If we need to cow a node, increase the write lock level and retry the tree search, there's no point of changing the node locks in our path to blocking mode, as we only waste time and unnecessarily wake up other tasks waiting on the spinning locks (just to block them again shortly after) because we release our path before repeating the tree search. Signed-off-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/ctree.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index bd0ae3ec76ff..783ea3bac7dc 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -2792,8 +2792,6 @@ again:
2792 if (!should_cow_block(trans, root, b)) 2792 if (!should_cow_block(trans, root, b))
2793 goto cow_done; 2793 goto cow_done;
2794 2794
2795 btrfs_set_path_blocking(p);
2796
2797 /* 2795 /*
2798 * must have write locks on this node and the 2796 * must have write locks on this node and the
2799 * parent 2797 * parent
@@ -2807,6 +2805,7 @@ again:
2807 goto again; 2805 goto again;
2808 } 2806 }
2809 2807
2808 btrfs_set_path_blocking(p);
2810 err = btrfs_cow_block(trans, root, b, 2809 err = btrfs_cow_block(trans, root, b,
2811 p->nodes[level + 1], 2810 p->nodes[level + 1],
2812 p->slots[level + 1], &b); 2811 p->slots[level + 1], &b);