]> www.infradead.org Git - users/dwmw2/linux.git/commit
btrfs: pass an inode to btrfs_add_extent_mapping()
authorFilipe Manana <fdmanana@suse.com>
Thu, 11 Jan 2024 15:13:35 +0000 (15:13 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 May 2024 19:31:03 +0000 (21:31 +0200)
commit0a308f8095f74c732e055c3d9f897d56e8ed6e82
tree64ba78a4c85a299a39fec3c6f01fea409c4cfaf0
parent236e3107fc807d38a62691b3e276d7a190a67953
btrfs: pass an inode to btrfs_add_extent_mapping()

Instead of passing fs_info and extent map tree arguments to
btrfs_add_extent_mapping(), we can pass an inode instead, as extent maps
are always inserted in the extent map tree of an inode, and the fs_info
can be extracted from the inode (inode->root->fs_info). The only exception
is in the self tests where we allocate an extent map tree and then use it
to insert/update/remove extent maps. However the tests can be changed to
use a test inode and then use the inode's extent map tree.

So change btrfs_add_extent_mapping() to have an inode as an argument
instead of a fs_info and an extent map tree. This reduces the number of
parameters and will also be needed for an upcoming change.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_map.c
fs/btrfs/extent_map.h
fs/btrfs/inode.c
fs/btrfs/tests/extent-map-tests.c