mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-03-30 19:07:15 +00:00
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>
This commit is contained in:
parent
c3e0696523
commit
155725c9c0
1 changed files with 1 additions and 2 deletions
|
@ -839,6 +839,7 @@ again:
|
||||||
}
|
}
|
||||||
ret = __add_delayed_refs(head, delayed_ref_seq,
|
ret = __add_delayed_refs(head, delayed_ref_seq,
|
||||||
&prefs_delayed);
|
&prefs_delayed);
|
||||||
|
mutex_unlock(&head->mutex);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
spin_unlock(&delayed_refs->lock);
|
spin_unlock(&delayed_refs->lock);
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -932,8 +933,6 @@ again:
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (head)
|
|
||||||
mutex_unlock(&head->mutex);
|
|
||||||
btrfs_free_path(path);
|
btrfs_free_path(path);
|
||||||
while (!list_empty(&prefs)) {
|
while (!list_empty(&prefs)) {
|
||||||
ref = list_first_entry(&prefs, struct __prelim_ref, list);
|
ref = list_first_entry(&prefs, struct __prelim_ref, list);
|
||||||
|
|
Loading…
Add table
Reference in a new issue