Skip to content

Commit

Permalink
btrfs: remove duplicated code to drop delayed ref during transaction …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
fdmanana authored and kdave committed Nov 11, 2024
1 parent c3a5888 commit 8d07a8f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions fs/btrfs/delayed-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8d07a8f

Please sign in to comment.