Hey Christoph, Hey Jan, This is an attempt to remove bdev->bd_inode and restrict direct access to the block layer, block drivers and few instances in fs/buffer.c where it's needed. Suggestions to do better welcome! Thanks! Christian Signed-off-by: Christian Brauner <brauner@xxxxxxxxxx> --- Christian Brauner (2): fs & block: remove bdev->bd_inode fs,drivers: remove bdev_inode() usage outside of block layer and drivers block/bdev.c | 48 ++++++++++-------- block/blk-zoned.c | 4 +- block/fops.c | 4 +- block/genhd.c | 8 +-- block/ioctl.c | 8 +-- block/partitions/core.c | 11 ++-- drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- drivers/md/bcache/super.c | 7 +-- drivers/md/md-bitmap.c | 2 +- drivers/mtd/devices/block2mtd.c | 4 +- drivers/s390/block/dasd_ioctl.c | 2 +- drivers/scsi/scsicam.c | 2 +- fs/affs/file.c | 2 +- fs/bcachefs/util.h | 5 -- fs/btrfs/dev-replace.c | 2 +- fs/btrfs/disk-io.c | 17 ++++--- fs/btrfs/disk-io.h | 4 +- fs/btrfs/inode.c | 2 +- fs/btrfs/super.c | 2 +- fs/btrfs/volumes.c | 26 +++++----- fs/btrfs/volumes.h | 2 +- fs/btrfs/zoned.c | 18 ++++--- fs/btrfs/zoned.h | 4 +- fs/buffer.c | 95 +++++++++++++++++++---------------- fs/cramfs/inode.c | 2 +- fs/direct-io.c | 7 +-- fs/erofs/data.c | 5 +- fs/erofs/internal.h | 1 + fs/erofs/zmap.c | 2 +- fs/ext2/inode.c | 4 +- fs/ext2/xattr.c | 2 +- fs/ext4/inode.c | 8 +-- fs/ext4/mmp.c | 2 +- fs/ext4/page-io.c | 4 +- fs/ext4/super.c | 7 ++- fs/ext4/xattr.c | 2 +- fs/f2fs/data.c | 7 ++- fs/f2fs/f2fs.h | 1 + fs/fuse/dax.c | 2 +- fs/gfs2/aops.c | 2 +- fs/gfs2/bmap.c | 2 +- fs/gfs2/glock.c | 2 +- fs/gfs2/meta_io.c | 2 +- fs/gfs2/ops_fstype.c | 2 +- fs/hpfs/file.c | 2 +- fs/iomap/buffered-io.c | 8 +-- fs/iomap/direct-io.c | 10 ++-- fs/iomap/swapfile.c | 2 +- fs/iomap/trace.h | 2 +- fs/jbd2/commit.c | 2 +- fs/jbd2/journal.c | 29 ++++++----- fs/jbd2/recovery.c | 6 +-- fs/jbd2/revoke.c | 10 ++-- fs/jbd2/transaction.c | 8 +-- fs/mpage.c | 26 ++++++---- fs/nilfs2/btnode.c | 4 +- fs/nilfs2/gcinode.c | 2 +- fs/nilfs2/mdt.c | 2 +- fs/nilfs2/page.c | 4 +- fs/nilfs2/recovery.c | 20 ++++---- fs/nilfs2/segment.c | 2 +- fs/nilfs2/the_nilfs.c | 1 + fs/nilfs2/the_nilfs.h | 1 + fs/ntfs/aops.c | 6 +-- fs/ntfs/file.c | 2 +- fs/ntfs/mft.c | 4 +- fs/ntfs3/fsntfs.c | 8 +-- fs/ntfs3/inode.c | 2 +- fs/ntfs3/super.c | 2 +- fs/ocfs2/aops.c | 2 +- fs/ocfs2/journal.c | 2 +- fs/reiserfs/fix_node.c | 2 +- fs/reiserfs/journal.c | 10 ++-- fs/reiserfs/prints.c | 4 +- fs/reiserfs/reiserfs.h | 6 +-- fs/reiserfs/stree.c | 2 +- fs/reiserfs/tail_conversion.c | 2 +- fs/xfs/xfs_iomap.c | 4 +- fs/zonefs/file.c | 4 +- include/linux/blk_types.h | 1 - include/linux/blkdev.h | 6 ++- include/linux/buffer_head.h | 68 ++++++++++++++++--------- include/linux/fs.h | 4 +- include/linux/iomap.h | 13 ++++- include/linux/jbd2.h | 10 ++-- include/trace/events/block.h | 2 +- 86 files changed, 363 insertions(+), 291 deletions(-) --- base-commit: 0bd1bf95a554f5f877724c27dbe33d4db0af4d0c change-id: 20240129-vfs-bdev-file-bd_inode-385a56c57a51