don't use ->bd_inode to access the block device size v2

Christoph Hellwig
2021-10-15T13:27:33Z

Hi Jens,

various drivers currently poke directy at the block device inode, which
is a bit of a mess. This series cleans up the places that read the
block device size to use the proper helpers. I have separate patches
for many of the other bd_inode uses, but this series is already big
enough as-is,

Changes since v1:
- move SECTOR_SIZE & co
- use SECTOR_SHIFT in sb_bdev_nr_blocks
- add a bdev_nr_bytes helper
- reuse a variable in the SCSI target code
- drop the block2mtd patch, a bigger rewrite for that code is pending

Diffstat:
block/fops.c | 2 +-
drivers/block/drbd/drbd_int.h | 3 +--
drivers/md/bcache/super.c | 2 +-
drivers/md/bcache/util.h | 4 ----
drivers/md/bcache/writeback.c | 2 +-
drivers/md/dm-bufio.c | 2 +-
drivers/md/dm-cache-metadata.c | 2 +-
drivers/md/dm-cache-target.c | 2 +-
drivers/md/dm-clone-target.c | 2 +-
drivers/md/dm-dust.c | 5 ++---
drivers/md/dm-ebs-target.c | 2 +-
drivers/md/dm-era-target.c | 2 +-
drivers/md/dm-exception-store.h | 2 +-
drivers/md/dm-flakey.c | 3 +--
drivers/md/dm-integrity.c | 6 +++---
drivers/md/dm-linear.c | 3 +--
drivers/md/dm-log-writes.c | 4 ++--
drivers/md/dm-log.c | 2 +-
drivers/md/dm-mpath.c | 2 +-
drivers/md/dm-raid.c | 6 +++---
drivers/md/dm-switch.c | 2 +-
drivers/md/dm-table.c | 3 +--
drivers/md/dm-thin-metadata.c | 2 +-
drivers/md/dm-thin.c | 2 +-
drivers/md/dm-verity-target.c | 3 +--
drivers/md/dm-writecache.c | 2 +-
drivers/md/dm-zoned-target.c | 2 +-
drivers/md/md.c | 26 +++++++++++---------------
drivers/nvme/target/io-cmd-bdev.c | 4 ++--
drivers/target/target_core_iblock.c | 4 ++--
fs/affs/super.c | 2 +-
fs/btrfs/dev-replace.c | 3 +--
fs/btrfs/disk-io.c | 2 +-
fs/btrfs/ioctl.c | 4 ++--
fs/btrfs/volumes.c | 8 ++++----
fs/buffer.c | 4 ++--
fs/cramfs/inode.c | 2 +-
fs/ext4/super.c | 2 +-
fs/fat/inode.c | 5 +----
fs/hfs/mdb.c | 2 +-
fs/hfsplus/wrapper.c | 2 +-
fs/jfs/resize.c | 5 ++---
fs/jfs/super.c | 5 ++---
fs/nfs/blocklayout/dev.c | 4 ++--
fs/nilfs2/ioctl.c | 2 +-
fs/nilfs2/super.c | 2 +-
fs/nilfs2/the_nilfs.c | 2 +-
fs/ntfs/super.c | 8 +++-----
fs/ntfs3/super.c | 3 +--
fs/pstore/blk.c | 8 +++-----
fs/reiserfs/super.c | 8 ++------
fs/squashfs/super.c | 5 +++--
fs/udf/lowlevel.c | 5 ++---
fs/udf/super.c | 9 +++------
include/linux/blk_types.h | 17 +++++++++++++++++
include/linux/blkdev.h | 17 -----------------
include/linux/genhd.h | 13 ++++++++++++-
57 files changed, 118 insertions(+), 139 deletions(-)