diff options
| author | Daniel Vacek <neelx@suse.com> | 2025-05-14 15:12:39 +0200 |
|---|---|---|
| committer | David Sterba <dsterba@suse.com> | 2025-07-21 23:53:25 +0200 |
| commit | d8f6cb2b28627fefa72e2ce1508db5781868a692 (patch) | |
| tree | 18367db47b6dc1a8800927bb3b6fa4b9b0a11c42 /fs/btrfs/backref.c | |
| parent | 593062f67b828ecbd74bcf41e8be44ccf7d72374 (diff) | |
btrfs: relocation: simplify unused logic related to LINK_LOWER
btrfs_backref_link_edge() is always called with the LINK_LOWER argument.
We can simplify it and remove the LINK_LOWER and LINK_UPPER macros
completely.
The last call with LINK_UPPER was removed with commit 0097422c0dfe0a
("btrfs: remove clone_backref_node() from relocation").
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Daniel Vacek <neelx@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.c')
| -rw-r--r-- | fs/btrfs/backref.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index ed497f5f8d1b..d011c64243c0 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -3161,18 +3161,14 @@ void btrfs_backref_release_cache(struct btrfs_backref_cache *cache) ASSERT(!cache->nr_edges); } -void btrfs_backref_link_edge(struct btrfs_backref_edge *edge, - struct btrfs_backref_node *lower, - struct btrfs_backref_node *upper, - int link_which) +static void btrfs_backref_link_edge(struct btrfs_backref_edge *edge, + struct btrfs_backref_node *lower, + struct btrfs_backref_node *upper) { ASSERT(upper && lower && upper->level == lower->level + 1); edge->node[LOWER] = lower; edge->node[UPPER] = upper; - if (link_which & LINK_LOWER) - list_add_tail(&edge->list[LOWER], &lower->upper); - if (link_which & LINK_UPPER) - list_add_tail(&edge->list[UPPER], &upper->lower); + list_add_tail(&edge->list[LOWER], &lower->upper); } /* * Handle direct tree backref @@ -3242,7 +3238,7 @@ static int handle_direct_tree_backref(struct btrfs_backref_cache *cache, ASSERT(upper->checked); INIT_LIST_HEAD(&edge->list[UPPER]); } - btrfs_backref_link_edge(edge, cur, upper, LINK_LOWER); + btrfs_backref_link_edge(edge, cur, upper); return 0; } @@ -3412,7 +3408,7 @@ static int handle_indirect_tree_backref(struct btrfs_trans_handle *trans, if (!upper->owner) upper->owner = btrfs_header_owner(eb); } - btrfs_backref_link_edge(edge, lower, upper, LINK_LOWER); + btrfs_backref_link_edge(edge, lower, upper); if (rb_node) { btrfs_put_root(root); |