linux-bcache.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* don't use ->bd_inode to access the block device size v2
@ 2021-10-15 13:26 Christoph Hellwig
  2021-10-15 13:26 ` [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h Christoph Hellwig
                   ` (29 more replies)
  0 siblings, 30 replies; 64+ messages in thread
From: Christoph Hellwig @ 2021-10-15 13:26 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Coly Li, Mike Snitzer, Song Liu, David Sterba, Josef Bacik,
	Theodore Ts'o, OGAWA Hirofumi, Dave Kleikamp,
	Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
	Kees Cook, Phillip Lougher, Jan Kara, linux-block, dm-devel,
	drbd-dev, linux-bcache, linux-raid, linux-nvme, linux-scsi,
	target-devel, linux-fsdevel, linux-btrfs, linux-ext4,
	jfs-discussion, linux-nfs, linux-nilfs, linux-ntfs-dev, ntfs3,
	reiserfs-devel

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(-)

^ permalink raw reply	[flat|nested] 64+ messages in thread
* don't use ->bd_inode to access the block device size v3
@ 2021-10-18 10:11 Christoph Hellwig
  2021-10-18 10:11 ` [PATCH 13/30] cramfs: use bdev_nr_bytes instead of open coding it Christoph Hellwig
  0 siblings, 1 reply; 64+ messages in thread
From: Christoph Hellwig @ 2021-10-18 10:11 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Coly Li, Mike Snitzer, Song Liu, David Sterba, Josef Bacik,
	Theodore Ts'o, OGAWA Hirofumi, Dave Kleikamp,
	Ryusuke Konishi, Anton Altaparmakov, Konstantin Komarov,
	Kees Cook, Phillip Lougher, Jan Kara, linux-block, dm-devel,
	drbd-dev, linux-bcache, linux-raid, linux-nvme, linux-scsi,
	target-devel, linux-fsdevel, linux-btrfs, linux-ext4,
	jfs-discussion, linux-nfs, linux-nilfs, linux-ntfs-dev, ntfs3,
	reiserfs-devel

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 v2:
 - bdev_nr_bytes should return loff_t
 - fix a commit message typo
 - drop a redundant note in a commit message

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(-)

^ permalink raw reply	[flat|nested] 64+ messages in thread

end of thread, other threads:[~2021-10-18 10:12 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-15 13:26 don't use ->bd_inode to access the block device size v2 Christoph Hellwig
2021-10-15 13:26 ` [PATCH 01/30] block: move the SECTOR_SIZE related definitions to blk_types.h Christoph Hellwig
2021-10-15 13:44   ` Jan Kara
2021-10-15 15:45   ` Kees Cook
2021-10-18  6:21   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 02/30] block: add a bdev_nr_bytes helper Christoph Hellwig
2021-10-15 13:35   ` Matthew Wilcox
2021-10-15 13:37     ` Christoph Hellwig
2021-10-15 14:37   ` Anton Altaparmakov
2021-10-15 15:49     ` Kees Cook
2021-10-15 13:26 ` [PATCH 03/30] bcache: remove bdev_sectors Christoph Hellwig
2021-10-18  5:46   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 04/30] drbd: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-15 18:00   ` Lee Duncan
2021-10-15 13:26 ` [PATCH 05/30] dm: use bdev_nr_sectors and bdev_nr_bytes instead of open coding them Christoph Hellwig
2021-10-15 13:26 ` [PATCH 06/30] md: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-15 13:26 ` [PATCH 07/30] nvmet: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 15:51   ` Kees Cook
2021-10-15 13:26 ` [PATCH 08/30] target/iblock: " Christoph Hellwig
2021-10-15 15:57   ` Kees Cook
2021-10-15 13:26 ` [PATCH 09/30] fs: use bdev_nr_bytes instead of open coding it in blkdev_max_block Christoph Hellwig
2021-10-15 16:00   ` Kees Cook
2021-10-15 13:26 ` [PATCH 10/30] fs: simplify init_page_buffers Christoph Hellwig
2021-10-15 13:26 ` [PATCH 11/30] affs: use bdev_nr_sectors instead of open coding it Christoph Hellwig
2021-10-18  6:22   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 12/30] btrfs: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 13:52   ` David Sterba
2021-10-15 16:59   ` Kees Cook
2021-10-15 13:26 ` [PATCH 13/30] cramfs: " Christoph Hellwig
2021-10-15 16:51   ` Kees Cook
2021-10-15 13:26 ` [PATCH 14/30] fat: use bdev_nr_sectors " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 15/30] hfs: " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 16/30] hfsplus: " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 17/30] jfs: use bdev_nr_bytes " Christoph Hellwig
2021-10-15 16:53   ` Kees Cook
2021-10-15 13:26 ` [PATCH 18/30] nfs/blocklayout: " Christoph Hellwig
2021-10-15 16:54   ` Kees Cook
2021-10-15 13:26 ` [PATCH 19/30] nilfs2: " Christoph Hellwig
2021-10-15 13:54   ` Ryusuke Konishi
2021-10-15 16:54   ` Kees Cook
2021-10-15 13:26 ` [PATCH 20/30] ntfs3: " Christoph Hellwig
2021-10-15 16:54   ` Kees Cook
2021-10-16  7:40   ` Kari Argillander
2021-10-15 13:26 ` [PATCH 21/30] pstore/blk: " Christoph Hellwig
2021-10-15 16:56   ` Kees Cook
2021-10-15 13:26 ` [PATCH 22/30] reiserfs: " Christoph Hellwig
2021-10-15 16:56   ` Kees Cook
2021-10-18  6:22   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 23/30] squashfs: " Christoph Hellwig
2021-10-15 16:57   ` Kees Cook
2021-10-15 13:26 ` [PATCH 24/30] block: use bdev_nr_bytes instead of open coding it in blkdev_fallocate Christoph Hellwig
2021-10-15 16:57   ` Kees Cook
2021-10-15 13:26 ` [PATCH 25/30] block: add a sb_bdev_nr_blocks helper Christoph Hellwig
2021-10-15 16:58   ` Kees Cook
2021-10-18  5:48   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 26/30] ext4: use sb_bdev_nr_blocks Christoph Hellwig
2021-10-18  5:48   ` Chaitanya Kulkarni
2021-10-15 13:26 ` [PATCH 27/30] jfs: " Christoph Hellwig
2021-10-15 14:16   ` Dave Kleikamp
2021-10-15 13:26 ` [PATCH 28/30] ntfs: " Christoph Hellwig
2021-10-15 14:35   ` Anton Altaparmakov
2021-10-15 13:26 ` [PATCH 29/30] reiserfs: " Christoph Hellwig
2021-10-15 13:26 ` [PATCH 30/30] udf: " Christoph Hellwig
2021-10-18 10:11 don't use ->bd_inode to access the block device size v3 Christoph Hellwig
2021-10-18 10:11 ` [PATCH 13/30] cramfs: use bdev_nr_bytes instead of open coding it Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).