diff options
author | Pan Chuang <panchuang@vivo.com> | 2025-05-16 11:03:32 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2025-07-21 23:53:26 +0200 |
commit | c52ea14d0544cfcd3c76ac9e3ce8ca16832cc033 (patch) | |
tree | 49163b4ad604f670a966ed13bcd5d39027af6c82 /fs/btrfs/backref.h | |
parent | fbec9a5d3e98513ce796194fe8604cade1aa3188 (diff) |
btrfs: pass struct rb_simple_node pointer directly in rb_simple_insert()
Replace struct embedding with union to enable safe type conversion in
btrfs_backref_node, tree_block and mapping_node.
Adjust function calls to use the new unified API, eliminating redundant
parameters.
Signed-off-by: Pan Chuang <panchuang@vivo.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/backref.h')
-rw-r--r-- | fs/btrfs/backref.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/fs/btrfs/backref.h b/fs/btrfs/backref.h index 507cfb35a23c..61f53825226d 100644 --- a/fs/btrfs/backref.h +++ b/fs/btrfs/backref.h @@ -313,10 +313,15 @@ int btrfs_backref_iter_next(struct btrfs_backref_iter *iter); * Represent a tree block in the backref cache */ struct btrfs_backref_node { - struct { - struct rb_node rb_node; - u64 bytenr; - }; /* Use rb_simple_node for search/insert */ + union{ + /* Use rb_simple_node for search/insert */ + struct { + struct rb_node rb_node; + u64 bytenr; + }; + + struct rb_simple_node simple_node; + }; /* * This is a sanity check, whenever we COW a block we will update |