mirror of
https://github.com/torvalds/linux.git
synced 2026-03-13 23:46:14 +01:00
btrfs: remove duplicated code to drop delayed ref during transaction abort
When destroying delayed refs during a transaction abort, we have open coded the removal of a delayed ref, which is also done by the static helper function drop_delayed_ref(). So remove that duplicated code and use drop_delayed_ref() instead. Reviewed-by: Boris Burkov <boris@bur.io> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c3a5888e0f
commit
8d07a8f4c6
1 changed files with 1 additions and 7 deletions
|
|
@ -1261,13 +1261,7 @@ void btrfs_destroy_delayed_refs(struct btrfs_transaction *trans)
|
|||
struct btrfs_delayed_ref_node *ref;
|
||||
|
||||
ref = rb_entry(n, struct btrfs_delayed_ref_node, ref_node);
|
||||
rb_erase_cached(&ref->ref_node, &head->ref_tree);
|
||||
RB_CLEAR_NODE(&ref->ref_node);
|
||||
if (!list_empty(&ref->add_list))
|
||||
list_del(&ref->add_list);
|
||||
atomic_dec(&delayed_refs->num_entries);
|
||||
btrfs_put_delayed_ref(ref);
|
||||
btrfs_delayed_refs_rsv_release(fs_info, 1, 0);
|
||||
drop_delayed_ref(fs_info, delayed_refs, head, ref);
|
||||
}
|
||||
if (head->must_insert_reserved)
|
||||
pin_bytes = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue