Re: [PATCH RFC 1/2] fs & block: remove bdev->bd_inode

Christian Brauner
2024-02-21T07:36:35Z

On Tue, Feb 20, 2024 at 07:57:12PM +0800, Yu Kuai wrote:
> Hi, Christian
>
> 在 2024/01/29 18:56, Christian Brauner 写道:
> > The only user that doesn't rely on files is the block layer itself in
> > block/fops.c where we only have access to the block device. As the bdev
> > filesystem doesn't open block devices as files obviously.
> >
> > This introduces a union into struct buffer_head and struct iomap. The
> > union encompasses both struct block_device and struct file. In both
> > cases a flag is used to differentiate whether a block device or a proper
> > file was stashed. Simple accessors bh_bdev() and iomap_bdev() are used
> > to return the block device in the really low-level functions where it's
> > needed. These are overall just a few callsites.
>
> I just realize that your implementation for iomap and buffer_head is
> better, if you don't mind. I'll split related changes into a seperate
> patch, and send out together.

Sure!