diff options
author | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-22 08:01:00 -0400 |
---|---|---|
committer | Jan Schmidt <list.btrfs@jan-o-sch.net> | 2012-06-27 10:34:39 -0400 |
commit | 155725c9c051a343be5e555bf943da827e6cf721 (patch) | |
tree | 2d9fcdaf376797b077c4e230de575686ec7e1709 /fs | |
parent | c3e0696523862c48b4d8c73ffb2867e9db478338 (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.c | 3 |
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 | ||
934 | out: | 935 | out: |
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); |