summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/backref.c
diff options
context:
space:
mode:
authorJan Schmidt <list.btrfs@jan-o-sch.net>2012-06-22 14:01:00 +0200
committerJan Schmidt <list.btrfs@jan-o-sch.net>2012-06-27 16:34:39 +0200
commit155725c9c051a343be5e555bf943da827e6cf721 (patch)
tree2d9fcdaf376797b077c4e230de575686ec7e1709 /fs/btrfs/backref.c
parentc3e0696523862c48b4d8c73ffb2867e9db478338 (diff)
downloadblackbird-op-linux-155725c9c051a343be5e555bf943da827e6cf721.tar.gz
blackbird-op-linux-155725c9c051a343be5e555bf943da827e6cf721.zip
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/btrfs/backref.c')
-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:
}
ret = __add_delayed_refs(head, delayed_ref_seq,
&prefs_delayed);
+ mutex_unlock(&head->mutex);
if (ret) {
spin_unlock(&delayed_refs->lock);
goto out;
@@ -932,8 +933,6 @@ again:
}
out:
- if (head)
- mutex_unlock(&head->mutex);
btrfs_free_path(path);
while (!list_empty(&prefs)) {
ref = list_first_entry(&prefs, struct __prelim_ref, list);
OpenPOWER on IntegriCloud