On Thu, Feb 22, 2024 at 08:45:40PM +0800, Yu Kuai wrote: > +static inline struct bdev_inode *BDEV_B(struct block_device *bdev) > +{ > + return container_of(bdev, struct bdev_inode, bdev); > +} > + > +struct inode *bdev_inode(struct block_device *bdev) > +{ > + return &BDEV_B(bdev)->vfs_inode; > +} > + > +struct address_space *bdev_mapping(struct block_device *bdev) > +{ > + return BDEV_B(bdev)->vfs_inode.i_mapping; > +} Nit: that might as well had been &BDEV_B(bdev)->vfs_inode.i_data These inodes always have ->i_mapping pointing their own ->i_data. If we ever change that, we would have enough bdev.c work on hands anyway.