]> www.infradead.org Git - users/jedix/linux-maple.git/commit
btrfs: remove extent_io_tree_to_inode() and is_inode_io_tree()
authorFilipe Manana <fdmanana@suse.com>
Thu, 3 Apr 2025 14:53:31 +0000 (15:53 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 15 May 2025 12:30:43 +0000 (14:30 +0200)
commit024b3bc190c06fd77d3db8126a63b1efeb641df9
treeed9fd39ef607430d25cb274728211bbbb6117273
parent9633f48190d8187c0622cb3ebcb65503809ab3f9
btrfs: remove extent_io_tree_to_inode() and is_inode_io_tree()

These functions aren't used outside extent-io-tree.c, but yet one of them
(extent_io_tree_to_inode()) is unnecessarily exported in the header.

Furthermore their single use is in a pattern like this:

    if (is_inode_io_tree(tree))
        foo(extent_io_tree_to_inode(tree), ...);

So we're effectively unnecessarily adding more indirection, checking
twice if tree->owner == IO_TREE_INODE_IO before getting the inode and
doing a non-inline function call to get tree->inode.

Simplify this by removing these helper functions and instead doing
thing like this:

   if (tree->owner == IO_TREE_INODE_IO)
       foo(tree->inode, ...);

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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-io-tree.c
fs/btrfs/extent-io-tree.h