aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2012-06-22 08:01:00 -0400
committerJan Schmidt <list.btrfs@jan-o-sch.net>2012-06-27 10:34:39 -0400
commit155725c9c051a343be5e555bf943da827e6cf721 (patch)
tree2d9fcdaf376797b077c4e230de575686ec7e1709 /fs
parentc3e0696523862c48b4d8c73ffb2867e9db478338 (diff)
Btrfs: leave critical region in btrfs_find_all_roots as soon as possible
When delayed refs exist, btrfs_find_all_roots used to hold the delayed ref mutex way longer than actually required. We ought to drop it immediately after we're done collecting all the delayed refs. Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/backref.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index cf0df904347f..a383c18e74e8 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -839,6 +839,7 @@ again:
839 } 839 }
840 ret = __add_delayed_refs(head, delayed_ref_seq, 840 ret = __add_delayed_refs(head, delayed_ref_seq,
841 &prefs_delayed); 841 &prefs_delayed);
842 mutex_unlock(&head->mutex);
842 if (ret) { 843 if (ret) {
843 spin_unlock(&delayed_refs->lock); 844 spin_unlock(&delayed_refs->lock);
844 goto out; 845 goto out;
@@ -932,8 +933,6 @@ again:
932 } 933 }
933 934
934out: 935out:
935 if (head)
936 mutex_unlock(&head->mutex);
937 btrfs_free_path(path); 936 btrfs_free_path(path);
938 while (!list_empty(&prefs)) { 937 while (!list_empty(&prefs)) {
939 ref = list_first_entry(&prefs, struct __prelim_ref, list); 938 ref = list_first_entry(&prefs, struct __prelim_ref, list);