btrfs: do not use a function to initialize btrfs_ref
authorJosef Bacik <josef@toxicpanda.com>
Fri, 12 Apr 2024 23:17:40 +0000 (19:17 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:04 +0000 (21:31 +0200)
commit4d09b4e942bce27c6fa66f3582dc639417107e2d
tree6b67ce0f9be0571a1a058f45dc8e7022af809200
parentd3fbb00f5e21c6dfaa6e820a21df0c9a3455a028
btrfs: do not use a function to initialize btrfs_ref

btrfs_ref currently has ->owning_root, and ->ref_root is shared between
the tree ref and data ref, so in order to move that into btrfs_ref
proper I would need to add another root parameter to the initialization
function.  This function has too many arguments, and adding another root
will make it easy to make mistakes about which root goes where.

Drop the generic ref init function and statically initialize the
btrfs_ref in every usage.  This makes the code easier to read because we
can see what elements we're assigning, and will make the upcoming change
moving the ref_root into the btrfs_ref more clear and less error prone
than adding a new element to the initialization function.

Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/delayed-ref.c
fs/btrfs/delayed-ref.h
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/inode-item.c
fs/btrfs/relocation.c
fs/btrfs/tree-log.c