Re: [PATCH 2/6] block: inline BDEV_I and friends

From: Christoph Hellwig
Date: Mon Oct 11 2021 - 04:23:49 EST


On Sat, Oct 09, 2021 at 01:25:39PM +0100, Pavel Begunkov wrote:
> I_BDEV and BDEV_I are very simple, they worth a single arith instruction
> or can even be almost completely compiled out. Inline them.

I see the benefit, but this is moving in the wrong direction.

struct bdev_inode is private to hide the struct inode. Which at
the momen is a bit pointless given the bd_inode pointer in struct
block_device.

So we have two choices here that make sense:

1) remove struct bdev_inode and kill the illusion that the inode
is a private implementation detail
2) remove direct references to bd_inode entirely. Most of them are
to i_size which already has proper helpers that should be used,
and the rest can probably be covered with a handful wrappes or
is bogus anyway