mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
btrfs: make btrfs_destroy_delayed_refs use btrfs_delayed_ref_lock
We have this open coded in btrfs_destroy_delayed_refs, use the helper instead. Reviewed-by: Nikolay Borisov <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
This commit is contained in:
committed by
David Sterba
parent
d1e1442065
commit
3069bd2669
+2
-9
@@ -4246,16 +4246,9 @@ static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
|
||||
|
||||
head = rb_entry(node, struct btrfs_delayed_ref_head,
|
||||
href_node);
|
||||
if (!mutex_trylock(&head->mutex)) {
|
||||
refcount_inc(&head->refs);
|
||||
spin_unlock(&delayed_refs->lock);
|
||||
|
||||
mutex_lock(&head->mutex);
|
||||
mutex_unlock(&head->mutex);
|
||||
btrfs_put_delayed_ref_head(head);
|
||||
spin_lock(&delayed_refs->lock);
|
||||
if (btrfs_delayed_ref_lock(delayed_refs, head))
|
||||
continue;
|
||||
}
|
||||
|
||||
spin_lock(&head->lock);
|
||||
while ((n = rb_first_cached(&head->ref_tree)) != NULL) {
|
||||
ref = rb_entry(n, struct btrfs_delayed_ref_node,
|
||||
|
||||
Reference in New Issue
Block a user