* use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* [Ocfs2-devel] use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [dm-devel] use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] use block_device based APIs in block layer consumers
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Hi Jens,
this series cleanups up the block layer API so that APIs consumed
by file systems are (almost) only struct block_devic based, so that
file systems don't have to poke into block layer internals like the
request_queue.
I also found a bunch of existing bugs related to partition offsets
and discard so these are fixed while going along.
Diffstat:
arch/um/drivers/ubd_kern.c | 2
block/blk-core.c | 4 -
block/blk-lib.c | 124 ++++++++++++++++++++---------------
block/blk-mq-debugfs.c | 2
block/blk-settings.c | 74 ++++++++++++++++++++
block/blk.h | 14 ---
block/fops.c | 2
block/genhd.c | 4 -
block/ioctl.c | 48 ++++++++++---
block/partitions/core.c | 12 ---
drivers/block/drbd/drbd_main.c | 53 +++++++-------
drivers/block/drbd/drbd_nl.c | 94 +++++++++++---------------
drivers/block/drbd/drbd_receiver.c | 13 +--
drivers/block/loop.c | 15 +---
drivers/block/nbd.c | 3
drivers/block/null_blk/main.c | 1
drivers/block/rbd.c | 1
drivers/block/rnbd/rnbd-clt.c | 6 -
drivers/block/rnbd/rnbd-srv-dev.h | 8 --
drivers/block/rnbd/rnbd-srv.c | 5 -
drivers/block/virtio_blk.c | 2
drivers/block/xen-blkback/blkback.c | 15 ++--
drivers/block/xen-blkback/xenbus.c | 9 --
drivers/block/xen-blkfront.c | 7 -
drivers/block/zram/zram_drv.c | 1
drivers/md/bcache/alloc.c | 2
drivers/md/bcache/request.c | 4 -
drivers/md/bcache/super.c | 3
drivers/md/bcache/sysfs.c | 2
drivers/md/dm-cache-target.c | 9 --
drivers/md/dm-clone-target.c | 9 --
drivers/md/dm-io.c | 2
drivers/md/dm-log-writes.c | 3
drivers/md/dm-raid.c | 9 --
drivers/md/dm-table.c | 25 +------
drivers/md/dm-thin.c | 15 ----
drivers/md/dm.c | 3
drivers/md/md-linear.c | 11 ---
drivers/md/md.c | 5 -
drivers/md/raid0.c | 7 -
drivers/md/raid1.c | 18 -----
drivers/md/raid10.c | 20 -----
drivers/md/raid5-cache.c | 8 +-
drivers/md/raid5.c | 14 +--
drivers/mmc/core/queue.c | 3
drivers/mtd/mtd_blkdevs.c | 1
drivers/nvme/host/core.c | 6 -
drivers/nvme/target/io-cmd-bdev.c | 2
drivers/nvme/target/zns.c | 3
drivers/s390/block/dasd_fba.c | 1
drivers/scsi/sd.c | 2
drivers/target/target_core_device.c | 19 ++---
drivers/target/target_core_file.c | 10 +-
drivers/target/target_core_iblock.c | 17 +---
fs/btrfs/disk-io.c | 3
fs/btrfs/extent-tree.c | 8 +-
fs/btrfs/ioctl.c | 12 +--
fs/btrfs/volumes.c | 4 -
fs/btrfs/zoned.c | 3
fs/direct-io.c | 32 +--------
fs/exfat/file.c | 5 -
fs/exfat/super.c | 10 --
fs/ext4/ioctl.c | 10 --
fs/ext4/mballoc.c | 10 +-
fs/ext4/super.c | 10 --
fs/f2fs/f2fs.h | 3
fs/f2fs/file.c | 19 ++---
fs/f2fs/segment.c | 8 --
fs/fat/file.c | 5 -
fs/fat/inode.c | 10 --
fs/gfs2/rgrp.c | 7 -
fs/iomap/direct-io.c | 3
fs/jbd2/journal.c | 9 --
fs/jfs/ioctl.c | 5 -
fs/jfs/super.c | 8 --
fs/nilfs2/ioctl.c | 6 -
fs/nilfs2/sufile.c | 4 -
fs/nilfs2/the_nilfs.c | 4 -
fs/ntfs3/file.c | 6 -
fs/ntfs3/super.c | 10 +-
fs/ocfs2/ioctl.c | 5 -
fs/super.c | 2
fs/xfs/xfs_discard.c | 8 +-
fs/xfs/xfs_log_cil.c | 2
fs/xfs/xfs_super.c | 12 +--
fs/zonefs/super.c | 3
include/linux/blkdev.h | 112 +++++++++++--------------------
include/target/target_core_backend.h | 4 -
mm/swapfile.c | 31 ++------
89 files changed, 493 insertions(+), 652 deletions(-)
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
For block devices the target code implements UNMAP as calls to
blkdev_issue_discard, which does not guarantee zeroing just because
Write Zeroes is supported.
Note that this does not affect the file backed path which uses
fallocate to punch holes.
Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 44bb380e7390c..fa866acef5bb2 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -850,7 +850,6 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
attrib->unmap_granularity_alignment = q->limits.discard_alignment /
block_size;
- attrib->unmap_zeroes_data = !!(q->limits.max_write_zeroes_sectors);
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:05 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:05 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
>
> Fixes: 2237498f0b5c ("target/iblock: Convert WRITE_SAME to blkdev_issue_zeroout")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [dm-devel] [PATCH 01/27] target: remove an incorrect unmap zeroes data deduction
@ 2022-04-07 3:06 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:06 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> For block devices the target code implements UNMAP as calls to
> blkdev_issue_discard, which does not guarantee zeroing just because
> Write Zeroes is supported.
>
> Note that this does not affect the file backed path which uses
> fallocate to punch holes.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The target code is a consumer of the block layer and should generally
work on struct block_device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 5 +++--
drivers/target/target_core_file.c | 7 ++++---
drivers/target/target_core_iblock.c | 2 +-
include/target/target_core_backend.h | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index fa866acef5bb2..3a1ec705cd80b 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -834,9 +834,10 @@ struct se_device *target_alloc_device(struct se_hba *hba, const char *name)
* in ATA and we need to set TPE=1
*/
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q)
+ struct block_device *bdev)
{
- int block_size = queue_logical_block_size(q);
+ struct request_queue *q = bdev_get_queue(bdev);
+ int block_size = bdev_logical_block_size(bdev);
if (!blk_queue_discard(q))
return false;
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8190b840065f3..8d191fdc33217 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -134,10 +134,11 @@ static int fd_configure_device(struct se_device *dev)
*/
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
- struct request_queue *q = bdev_get_queue(I_BDEV(inode));
+ struct block_device *bdev = I_BDEV(inode);
+ struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
- fd_dev->fd_block_size = bdev_logical_block_size(I_BDEV(inode));
+ fd_dev->fd_block_size = bdev_logical_block_size(bdev);
/*
* Determine the number of bytes from i_size_read() minus
* one (1) logical sector from underlying struct block_device
@@ -150,7 +151,7 @@ static int fd_configure_device(struct se_device *dev)
dev_size, div_u64(dev_size, fd_dev->fd_block_size),
fd_dev->fd_block_size);
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bdev))
pr_debug("IFILE: BLOCK Discard support available,"
" disabled by default\n");
/*
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 87ede165ddba4..b886ce1770bfd 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -119,7 +119,7 @@ static int iblock_configure_device(struct se_device *dev)
dev->dev_attrib.hw_max_sectors = queue_max_hw_sectors(q);
dev->dev_attrib.hw_queue_depth = q->nr_requests;
- if (target_configure_unmap_from_queue(&dev->dev_attrib, q))
+ if (target_configure_unmap_from_queue(&dev->dev_attrib, bd))
pr_debug("IBLOCK: BLOCK Discard support available,"
" disabled by default\n");
diff --git a/include/target/target_core_backend.h b/include/target/target_core_backend.h
index 675f3a1fe6139..773963a1e0b53 100644
--- a/include/target/target_core_backend.h
+++ b/include/target/target_core_backend.h
@@ -14,7 +14,7 @@
#define TRANSPORT_FLAG_PASSTHROUGH_ALUA 0x2
#define TRANSPORT_FLAG_PASSTHROUGH_PGR 0x4
-struct request_queue;
+struct block_device;
struct scatterlist;
struct target_backend_ops {
@@ -117,7 +117,7 @@ sense_reason_t passthrough_parse_cdb(struct se_cmd *cmd,
bool target_sense_desc_format(struct se_device *dev);
sector_t target_to_linux_sector(struct se_device *dev, sector_t lb);
bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
- struct request_queue *q);
+ struct block_device *bdev);
static inline bool target_dev_configured(struct se_device *se_dev)
{
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
2022-04-06 6:04 ` Christoph Hellwig
` (3 preceding siblings ...)
(?)
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 02/27] target: pass a block_device to target_configure_unmap_from_queue
@ 2022-04-07 3:07 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:07 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> The target code is a consumer of the block layer and should generally
> work on struct block_device.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 03/27] target: fix discard alignment on partitions
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the proper bdev_discard_alignment helper that accounts for partition
offsets.
Fіxes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/target/target_core_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index 3a1ec705cd80b..16e775bcf4a7c 100644
--- a/drivers/target/target_core_device.c
+++ b/drivers/target/target_core_device.c
@@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib,
*/
attrib->max_unmap_block_desc_count = 1;
attrib->unmap_granularity = q->limits.discard_granularity / block_size;
- attrib->unmap_granularity_alignment = q->limits.discard_alignment /
- block_size;
+ attrib->unmap_granularity_alignment =
+ bdev_discard_alignment(bdev) / block_size;
return true;
}
EXPORT_SYMBOL(target_configure_unmap_from_queue);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
2022-04-06 6:04 ` Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:14 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 03/27] target: fix discard alignment on partitions
@ 2022-04-07 3:14 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:14 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Use the proper bdev_discard_alignment helper that accounts for partition
> offsets.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 04/27] drbd: remove assign_p_sizes_qlim
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 04/27] drbd: remove assign_p_sizes_qlim
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Fold each branch into its only caller.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
1 file changed, 23 insertions(+), 27 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 9676a1d214bc5..74b1b2424efff 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
}
}
-/* communicated if (agreed_features & DRBD_FF_WSAME) */
-static void
-assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
- struct request_queue *q)
-{
- if (q) {
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable = 0;
- } else {
- q = device->rq_queue;
- p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
- p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
- p->qlim->alignment_offset = 0;
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
- p->qlim->discard_enabled = 0;
- p->qlim->write_same_capable = 0;
- }
-}
-
int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
{
struct drbd_device *device = peer_device->device;
@@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
q_order_type = drbd_queue_order_type(device);
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
- assign_p_sizes_qlim(device, p, q);
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset =
+ cpu_to_be32(queue_alignment_offset(q));
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = blk_queue_discard(q);
+ p->qlim->write_same_capable =
+ !!q->limits.max_write_same_sectors;
put_ldev(device);
} else {
+ struct request_queue *q = device->rq_queue;
+
+ p->qlim->physical_block_size =
+ cpu_to_be32(queue_physical_block_size(q));
+ p->qlim->logical_block_size =
+ cpu_to_be32(queue_logical_block_size(q));
+ p->qlim->alignment_offset = 0;
+ p->qlim->io_min = cpu_to_be32(queue_io_min(q));
+ p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->discard_enabled = 0;
+ p->qlim->write_same_capable = 0;
+
d_size = 0;
u_size = 0;
q_order_type = QUEUE_ORDERED_NONE;
max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
- assign_p_sizes_qlim(device, p, NULL);
}
if (peer_device->connection->agreed_pro_version <= 94)
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Drbd-dev] [PATCH 04/27] drbd: remove assign_p_sizes_qlim
2022-04-06 6:04 ` Christoph Hellwig
` (5 preceding siblings ...)
(?)
@ 2022-04-06 9:09 ` Christoph Böhmwalder
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Böhmwalder @ 2022-04-06 9:09 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: drbd-dev, linux-block, Jens Axboe
Am 06.04.22 um 08:04 schrieb Christoph Hellwig:
> Fold each branch into its only caller.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/drbd/drbd_main.c | 50 ++++++++++++++++------------------
> 1 file changed, 23 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index 9676a1d214bc5..74b1b2424efff 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -903,31 +903,6 @@ void drbd_gen_and_send_sync_uuid(struct drbd_peer_device *peer_device)
> }
> }
>
> -/* communicated if (agreed_features & DRBD_FF_WSAME) */
> -static void
> -assign_p_sizes_qlim(struct drbd_device *device, struct p_sizes *p,
> - struct request_queue *q)
> -{
> - if (q) {
> - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
> - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
> - p->qlim->alignment_offset = cpu_to_be32(queue_alignment_offset(q));
> - p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> - p->qlim->discard_enabled = blk_queue_discard(q);
> - p->qlim->write_same_capable = 0;
> - } else {
> - q = device->rq_queue;
> - p->qlim->physical_block_size = cpu_to_be32(queue_physical_block_size(q));
> - p->qlim->logical_block_size = cpu_to_be32(queue_logical_block_size(q));
> - p->qlim->alignment_offset = 0;
> - p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> - p->qlim->discard_enabled = 0;
> - p->qlim->write_same_capable = 0;
> - }
> -}
> -
> int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enum dds_flags flags)
> {
> struct drbd_device *device = peer_device->device;
> @@ -957,14 +932,35 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
> q_order_type = drbd_queue_order_type(device);
> max_bio_size = queue_max_hw_sectors(q) << 9;
> max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
> - assign_p_sizes_qlim(device, p, q);
> + p->qlim->physical_block_size =
> + cpu_to_be32(queue_physical_block_size(q));
> + p->qlim->logical_block_size =
> + cpu_to_be32(queue_logical_block_size(q));
> + p->qlim->alignment_offset =
> + cpu_to_be32(queue_alignment_offset(q));
> + p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> + p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> + p->qlim->discard_enabled = blk_queue_discard(q);
> + p->qlim->write_same_capable =
> + !!q->limits.max_write_same_sectors;
queue_limits.max_write_same_sectors was removed in 73bd66d9c834, so this
does not compile. It's removed in the next patch, so the big picture is
fine, just this one commit is broken.
> put_ldev(device);
> } else {
> + struct request_queue *q = device->rq_queue;
> +
> + p->qlim->physical_block_size =
> + cpu_to_be32(queue_physical_block_size(q));
> + p->qlim->logical_block_size =
> + cpu_to_be32(queue_logical_block_size(q));
> + p->qlim->alignment_offset = 0;
> + p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> + p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> + p->qlim->discard_enabled = 0;
> + p->qlim->write_same_capable = 0;
> +
> d_size = 0;
> u_size = 0;
> q_order_type = QUEUE_ORDERED_NONE;
> max_bio_size = DRBD_MAX_BIO_SIZE; /* ... multiple BIOs per peer_request */
> - assign_p_sizes_qlim(device, p, NULL);
> }
>
> if (peer_device->connection->agreed_pro_version <= 94)
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based limits helpers where they exist.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 74b1b2424efff..d20d84ee7a88e 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
memset(p, 0, packet_size);
if (get_ldev_if_state(device, D_NEGOTIATING)) {
- struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
+ struct block_device *bdev = device->ldev->backing_bdev;
+ struct request_queue *q = bdev_get_queue(bdev);
+
d_size = drbd_get_max_capacity(device->ldev);
rcu_read_lock();
u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
@@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
max_bio_size = queue_max_hw_sectors(q) << 9;
max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
p->qlim->physical_block_size =
- cpu_to_be32(queue_physical_block_size(q));
+ cpu_to_be32(bdev_physical_block_size(bdev));
p->qlim->logical_block_size =
- cpu_to_be32(queue_logical_block_size(q));
+ cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
cpu_to_be32(queue_alignment_offset(q));
- p->qlim->io_min = cpu_to_be32(queue_io_min(q));
- p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
+ p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
+ p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
- p->qlim->write_same_capable =
- !!q->limits.max_write_same_sectors;
+ p->qlim->write_same_capable = 0;
put_ldev(device);
} else {
struct request_queue *q = device->rq_queue;
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Drbd-dev] [PATCH 05/27] drbd: use bdev based limit helpers in drbd_send_sizes
2022-04-06 6:04 ` Christoph Hellwig
` (5 preceding siblings ...)
(?)
@ 2022-04-06 9:20 ` Christoph Böhmwalder
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Böhmwalder @ 2022-04-06 9:20 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: drbd-dev, linux-block, Jens Axboe
Am 06.04.22 um 08:04 schrieb Christoph Hellwig:
> Use the bdev based limits helpers where they exist.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/drbd/drbd_main.c | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index 74b1b2424efff..d20d84ee7a88e 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -924,7 +924,9 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
>
> memset(p, 0, packet_size);
> if (get_ldev_if_state(device, D_NEGOTIATING)) {
> - struct request_queue *q = bdev_get_queue(device->ldev->backing_bdev);
> + struct block_device *bdev = device->ldev->backing_bdev;
> + struct request_queue *q = bdev_get_queue(bdev);
> +
> d_size = drbd_get_max_capacity(device->ldev);
> rcu_read_lock();
> u_size = rcu_dereference(device->ldev->disk_conf)->disk_size;
> @@ -933,16 +935,15 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
> max_bio_size = queue_max_hw_sectors(q) << 9;
> max_bio_size = min(max_bio_size, DRBD_MAX_BIO_SIZE);
> p->qlim->physical_block_size =
> - cpu_to_be32(queue_physical_block_size(q));
> + cpu_to_be32(bdev_physical_block_size(bdev));
> p->qlim->logical_block_size =
> - cpu_to_be32(queue_logical_block_size(q));
> + cpu_to_be32(bdev_logical_block_size(bdev));
> p->qlim->alignment_offset =
> cpu_to_be32(queue_alignment_offset(q));
> - p->qlim->io_min = cpu_to_be32(queue_io_min(q));
> - p->qlim->io_opt = cpu_to_be32(queue_io_opt(q));
> + p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
> + p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
> p->qlim->discard_enabled = blk_queue_discard(q);
> - p->qlim->write_same_capable =
> - !!q->limits.max_write_same_sectors;
> + p->qlim->write_same_capable = 0;
> put_ldev(device);
> } else {
> struct request_queue *q = device->rq_queue;
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 06/27] drbd: cleanup decide_on_discard_support
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 06/27] drbd: cleanup decide_on_discard_support
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Sanitize the calling conventions and use a goto label to cleanup the
code flow.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
1 file changed, 35 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 02030c9c4d3b1..40bb0b356a6d6 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
}
static void decide_on_discard_support(struct drbd_device *device,
- struct request_queue *q,
- struct request_queue *b,
- bool discard_zeroes_if_aligned)
+ struct drbd_backing_dev *bdev)
{
- /* q = drbd device queue (device->rq_queue)
- * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
- * or NULL if diskless
- */
- struct drbd_connection *connection = first_peer_device(device)->connection;
- bool can_do = b ? blk_queue_discard(b) : true;
-
- if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
- can_do = false;
- drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
- }
- if (can_do) {
- /* We don't care for the granularity, really.
- * Stacking limits below should fix it for the local
- * device. Whether or not it is a suitable granularity
- * on the remote device is not our problem, really. If
- * you care, you need to use devices with similar
- * topology on all peers. */
- blk_queue_discard_granularity(q, 512);
- q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
- blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
- q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
- } else {
- blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
- blk_queue_discard_granularity(q, 0);
- q->limits.max_discard_sectors = 0;
- q->limits.max_write_zeroes_sectors = 0;
+ struct drbd_connection *connection =
+ first_peer_device(device)->connection;
+ struct request_queue *q = device->rq_queue;
+
+ if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
+ goto not_supported;
+
+ if (connection->cstate >= C_CONNECTED &&
+ !(connection->agreed_features & DRBD_FF_TRIM)) {
+ drbd_info(connection,
+ "peer DRBD too old, does not support TRIM: disabling discards\n");
+ goto not_supported;
}
+
+ /*
+ * We don't care for the granularity, really.
+ *
+ * Stacking limits below should fix it for the local device. Whether or
+ * not it is a suitable granularity on the remote device is not our
+ * problem, really. If you care, you need to use devices with similar
+ * topology on all peers.
+ */
+ blk_queue_discard_granularity(q, 512);
+ q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
+ blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
+ q->limits.max_write_zeroes_sectors =
+ drbd_max_discard_sectors(connection);
+ return;
+
+not_supported:
+ blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
+ blk_queue_discard_granularity(q, 0);
+ q->limits.max_discard_sectors = 0;
+ q->limits.max_write_zeroes_sectors = 0;
}
static void fixup_discard_if_not_supported(struct request_queue *q)
@@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
unsigned int max_segments = 0;
struct request_queue *b = NULL;
struct disk_conf *dc;
- bool discard_zeroes_if_aligned = true;
if (bdev) {
b = bdev->backing_bdev->bd_disk->queue;
@@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
rcu_read_lock();
dc = rcu_dereference(device->ldev->disk_conf);
max_segments = dc->max_bio_bvecs;
- discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
rcu_read_unlock();
blk_set_stacking_limits(&q->limits);
@@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
/* This is the workaround for "bio would need to, but cannot, be split" */
blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
blk_queue_segment_boundary(q, PAGE_SIZE-1);
- decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
+ decide_on_discard_support(device, bdev);
if (b) {
blk_stack_limits(&q->limits, &b->limits, 0);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Drbd-dev] [PATCH 06/27] drbd: cleanup decide_on_discard_support
2022-04-06 6:04 ` Christoph Hellwig
` (5 preceding siblings ...)
(?)
@ 2022-04-06 9:28 ` Christoph Böhmwalder
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Böhmwalder @ 2022-04-06 9:28 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: drbd-dev, linux-block, Jens Axboe
Am 06.04.22 um 08:04 schrieb Christoph Hellwig:
> Sanitize the calling conventions and use a goto label to cleanup the
> code flow.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/drbd/drbd_nl.c | 68 +++++++++++++++++++-----------------
> 1 file changed, 35 insertions(+), 33 deletions(-)
>
> diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
> index 02030c9c4d3b1..40bb0b356a6d6 100644
> --- a/drivers/block/drbd/drbd_nl.c
> +++ b/drivers/block/drbd/drbd_nl.c
> @@ -1204,38 +1204,42 @@ static unsigned int drbd_max_discard_sectors(struct drbd_connection *connection)
> }
>
> static void decide_on_discard_support(struct drbd_device *device,
> - struct request_queue *q,
> - struct request_queue *b,
> - bool discard_zeroes_if_aligned)
> + struct drbd_backing_dev *bdev)
> {
> - /* q = drbd device queue (device->rq_queue)
> - * b = backing device queue (device->ldev->backing_bdev->bd_disk->queue),
> - * or NULL if diskless
> - */
> - struct drbd_connection *connection = first_peer_device(device)->connection;
> - bool can_do = b ? blk_queue_discard(b) : true;
> -
> - if (can_do && connection->cstate >= C_CONNECTED && !(connection->agreed_features & DRBD_FF_TRIM)) {
> - can_do = false;
> - drbd_info(connection, "peer DRBD too old, does not support TRIM: disabling discards\n");
> - }
> - if (can_do) {
> - /* We don't care for the granularity, really.
> - * Stacking limits below should fix it for the local
> - * device. Whether or not it is a suitable granularity
> - * on the remote device is not our problem, really. If
> - * you care, you need to use devices with similar
> - * topology on all peers. */
> - blk_queue_discard_granularity(q, 512);
> - q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
> - blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
> - q->limits.max_write_zeroes_sectors = drbd_max_discard_sectors(connection);
> - } else {
> - blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
> - blk_queue_discard_granularity(q, 0);
> - q->limits.max_discard_sectors = 0;
> - q->limits.max_write_zeroes_sectors = 0;
> + struct drbd_connection *connection =
> + first_peer_device(device)->connection;
> + struct request_queue *q = device->rq_queue;
> +
> + if (bdev && !blk_queue_discard(bdev->backing_bdev->bd_disk->queue))
> + goto not_supported;
> +
> + if (connection->cstate >= C_CONNECTED &&
> + !(connection->agreed_features & DRBD_FF_TRIM)) {
> + drbd_info(connection,
> + "peer DRBD too old, does not support TRIM: disabling discards\n");
> + goto not_supported;
> }
> +
> + /*
> + * We don't care for the granularity, really.
> + *
> + * Stacking limits below should fix it for the local device. Whether or
> + * not it is a suitable granularity on the remote device is not our
> + * problem, really. If you care, you need to use devices with similar
> + * topology on all peers.
> + */
> + blk_queue_discard_granularity(q, 512);
> + q->limits.max_discard_sectors = drbd_max_discard_sectors(connection);
> + blk_queue_flag_set(QUEUE_FLAG_DISCARD, q);
> + q->limits.max_write_zeroes_sectors =
> + drbd_max_discard_sectors(connection);
> + return;
> +
> +not_supported:
> + blk_queue_flag_clear(QUEUE_FLAG_DISCARD, q);
> + blk_queue_discard_granularity(q, 0);
> + q->limits.max_discard_sectors = 0;
> + q->limits.max_write_zeroes_sectors = 0;
> }
>
> static void fixup_discard_if_not_supported(struct request_queue *q)
> @@ -1273,7 +1277,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
> unsigned int max_segments = 0;
> struct request_queue *b = NULL;
> struct disk_conf *dc;
> - bool discard_zeroes_if_aligned = true;
>
> if (bdev) {
> b = bdev->backing_bdev->bd_disk->queue;
> @@ -1282,7 +1285,6 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
> rcu_read_lock();
> dc = rcu_dereference(device->ldev->disk_conf);
> max_segments = dc->max_bio_bvecs;
> - discard_zeroes_if_aligned = dc->discard_zeroes_if_aligned;
> rcu_read_unlock();
>
> blk_set_stacking_limits(&q->limits);
> @@ -1292,7 +1294,7 @@ static void drbd_setup_queue_param(struct drbd_device *device, struct drbd_backi
> /* This is the workaround for "bio would need to, but cannot, be split" */
> blk_queue_max_segments(q, max_segments ? max_segments : BLK_MAX_SEGMENTS);
> blk_queue_segment_boundary(q, PAGE_SIZE-1);
> - decide_on_discard_support(device, q, b, discard_zeroes_if_aligned);
> + decide_on_discard_support(device, bdev);
>
> if (b) {
> blk_stack_limits(&q->limits, &b->limits, 0);
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/btrfs/zoned.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/btrfs/zoned.c b/fs/btrfs/zoned.c
index b7b5fac1c7790..5b85004d85d6c 100644
--- a/fs/btrfs/zoned.c
+++ b/fs/btrfs/zoned.c
@@ -350,7 +350,6 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
struct btrfs_fs_info *fs_info = device->fs_info;
struct btrfs_zoned_device_info *zone_info = NULL;
struct block_device *bdev = device->bdev;
- struct request_queue *queue = bdev_get_queue(bdev);
unsigned int max_active_zones;
unsigned int nactive;
sector_t nr_sectors;
@@ -410,7 +409,7 @@ int btrfs_get_dev_zone_info(struct btrfs_device *device, bool populate_cache)
if (!IS_ALIGNED(nr_sectors, zone_sectors))
zone_info->nr_zones++;
- max_active_zones = queue_max_active_zones(queue);
+ max_active_zones = bdev_max_active_zones(bdev);
if (max_active_zones && max_active_zones < BTRFS_MIN_ACTIVE_ZONES) {
btrfs_err_in_rcu(fs_info,
"zoned: %s: max active zones %u is too small, need at least %u active zones",
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
2022-04-06 6:04 ` Christoph Hellwig
` (2 preceding siblings ...)
(?)
@ 2022-04-06 9:56 ` Johannes Thumshirn
-1 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn via Ocfs2-devel @ 2022-04-06 9:56 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 9:56 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn via Linux-f2fs-devel @ 2022-04-06 9:56 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 9:56 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:56 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 9:56 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:56 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-06 9:56 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:56 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
2022-04-06 6:04 ` Christoph Hellwig
` (3 preceding siblings ...)
(?)
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:20 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba via Ocfs2-devel @ 2022-04-07 15:20 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> Signed-off-by: Christoph Hellwig <hch@lst.de>
As it's a standalone patch I can take it (possibly with other similar
prep btrfs patches) in current development cycle to relieve the
inter-tree dependencies.
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
2022-04-07 15:20 ` [Ocfs2-devel] " David Sterba via Ocfs2-devel
` (2 preceding siblings ...)
(?)
@ 2022-04-07 15:26 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-07 15:26 UTC (permalink / raw)
To: dsterba, Christoph Hellwig, Jens Axboe, dm-devel, linux-xfs,
linux-fsdevel, linux-um, linux-block, drbd-dev, nbd, ceph-devel,
virtualization, xen-devel, linux-bcache, linux-raid, linux-mmc,
linux-mtd, linux-nvme, linux-s390, linux-scsi, target-devel,
linux-btrfs, linux-ext4, linux-f2fs-devel, cluster-devel,
jfs-discussion, linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in current development cycle to relieve the
> inter-tree dependencies.
Unless there's a conflict in other btrfs patches it would probably be
easiest to merge everything through the block tree.
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:26 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-07 15:26 UTC (permalink / raw)
To: dsterba, Christoph Hellwig, Jens Axboe, dm-devel, linux-xfs,
linux-fsdevel, linux-um, linux-block, drbd-dev, nbd, ceph-devel,
virtualization, xen-devel, linux-bcache, linux-raid, linux-mmc,
linux-mtd, linux-nvme, linux-s390, linux-scsi, target-devel,
linux-btrfs, linux-ext4, linux-f2fs-devel, cluster-devel,
jfs-discussion, linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in current development cycle to relieve the
> inter-tree dependencies.
Unless there's a conflict in other btrfs patches it would probably be
easiest to merge everything through the block tree.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:26 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-07 15:26 UTC (permalink / raw)
To: dsterba, Christoph Hellwig, Jens Axboe, dm-devel, linux-xfs,
linux-fsdevel, linux-um, linux-block, drbd-dev, nbd, ceph-devel,
virtualization, xen-devel, linux-bcache, linux-raid, linux-mmc,
linux-mtd, linux-nvme, linux-s390, linux-scsi, target-devel,
linux-btrfs, linux-ext4, linux-f2fs-devel, cluster-devel,
jfs-discussion, linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in current development cycle to relieve the
> inter-tree dependencies.
Unless there's a conflict in other btrfs patches it would probably be
easiest to merge everything through the block tree.
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:26 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-07 15:26 UTC (permalink / raw)
To: dsterba, Christoph Hellwig, Jens Axboe, dm-devel, linux-xfs,
linux-fsdevel, linux-um, linux-block, drbd-dev, nbd, ceph-devel,
virtualization, xen-devel, linux-bcache, linux-raid, linux-mmc,
linux-mtd, linux-nvme, linux-s390, linux-scsi, target-devel,
linux-btrfs, linux-ext4, linux-f2fs-devel, cluster-devel,
jfs-discussion, linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in current development cycle to relieve the
> inter-tree dependencies.
Unless there's a conflict in other btrfs patches it would probably be
easiest to merge everything through the block tree.
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 07/27] btrfs: use bdev_max_active_zones instead of open coding it
@ 2022-04-07 15:26 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-07 15:26 UTC (permalink / raw)
To: dsterba, Christoph Hellwig, Jens Axboe, dm-devel, linux-xfs,
linux-fsdevel, linux-um, linux-block, drbd-dev, nbd, ceph-devel,
virtualization, xen-devel, linux-bcache, linux-raid, linux-mmc,
linux-mtd, linux-nvme, linux-s390, linux-scsi, target-devel,
linux-btrfs, linux-ext4, linux-f2fs-devel, cluster-devel,
jfs-discussion, linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Thu, Apr 07, 2022 at 05:20:49PM +0200, David Sterba wrote:
> On Wed, Apr 06, 2022 at 08:04:56AM +0200, Christoph Hellwig wrote:
> > Signed-off-by: Christoph Hellwig <hch@lst.de>
>
> As it's a standalone patch I can take it (possibly with other similar
> prep btrfs patches) in current development cycle to relieve the
> inter-tree dependencies.
Unless there's a conflict in other btrfs patches it would probably be
easiest to merge everything through the block tree.
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 08/27] ntfs3: use bdev_logical_block_size instead of open coding it
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ntfs3/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 278dcf5024102..cd30e81abbce0 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -920,7 +920,7 @@ static int ntfs_fill_super(struct super_block *sb, struct fs_context *fc)
}
/* Parse boot. */
- err = ntfs_init_from_boot(sb, rq ? queue_logical_block_size(rq) : 512,
+ err = ntfs_init_from_boot(sb, bdev_logical_block_size(bdev),
bdev_nr_bytes(bdev));
if (err)
goto out;
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 09/27] mm: use bdev_is_zoned in claim_swapfile
@ 2022-04-06 6:04 ` Christoph Hellwig
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Use the bdev based helper instead of poking into the queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
mm/swapfile.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63c61f8b26118..4c7537162af5e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2761,7 +2761,7 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
* write only restriction. Hence zoned block devices are not
* suitable for swapping. Disallow them here.
*/
- if (blk_queue_is_zoned(p->bdev->bd_disk->queue))
+ if (bdev_is_zoned(p->bdev))
return -EINVAL;
p->flags |= SWP_BLKDEV;
} else if (S_ISREG(inode->i_mode)) {
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 10/27] block: add a bdev_nonrot helper
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-06 6:04 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:04 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the nonrot flag based on the block_device instead
of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/ioctl.c | 2 +-
drivers/block/loop.c | 2 +-
drivers/md/dm-table.c | 4 +---
drivers/md/md.c | 3 +--
drivers/md/raid1.c | 2 +-
drivers/md/raid10.c | 2 +-
drivers/md/raid5.c | 2 +-
drivers/target/target_core_file.c | 3 +--
drivers/target/target_core_iblock.c | 2 +-
fs/btrfs/volumes.c | 4 ++--
fs/ext4/mballoc.c | 2 +-
include/linux/blkdev.h | 5 +++++
mm/swapfile.c | 4 ++--
13 files changed, 19 insertions(+), 18 deletions(-)
diff --git a/block/ioctl.c b/block/ioctl.c
index 4a86340133e46..ad3771b268b81 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -489,7 +489,7 @@ static int blkdev_common_ioctl(struct block_device *bdev, fmode_t mode,
queue_max_sectors(bdev_get_queue(bdev)));
return put_ushort(argp, max_sectors);
case BLKROTATIONAL:
- return put_ushort(argp, !blk_queue_nonrot(bdev_get_queue(bdev)));
+ return put_ushort(argp, !bdev_nonrot(bdev));
case BLKRASET:
case BLKFRASET:
if(!capable(CAP_SYS_ADMIN))
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a58595f5ee2c8..8d800d46e4985 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -903,7 +903,7 @@ static void loop_update_rotational(struct loop_device *lo)
/* not all filesystems (e.g. tmpfs) have a sb->s_bdev */
if (file_bdev)
- nonrot = blk_queue_nonrot(bdev_get_queue(file_bdev));
+ nonrot = bdev_nonrot(file_bdev);
if (nonrot)
blk_queue_flag_set(QUEUE_FLAG_NONROT, q);
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 03541cfc2317c..5e38d0dd009d5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1820,9 +1820,7 @@ static int device_dax_write_cache_enabled(struct dm_target *ti,
static int device_is_rotational(struct dm_target *ti, struct dm_dev *dev,
sector_t start, sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return !blk_queue_nonrot(q);
+ return !bdev_nonrot(dev->bdev);
}
static int device_is_not_random(struct dm_target *ti, struct dm_dev *dev,
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 309b3af906ad3..19636c2f2cda4 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -5991,8 +5991,7 @@ int md_run(struct mddev *mddev)
bool nonrot = true;
rdev_for_each(rdev, mddev) {
- if (rdev->raid_disk >= 0 &&
- !blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (rdev->raid_disk >= 0 && !bdev_nonrot(rdev->bdev)) {
nonrot = false;
break;
}
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
index 99d5464a51f81..d81b896855f9f 100644
--- a/drivers/md/raid1.c
+++ b/drivers/md/raid1.c
@@ -704,7 +704,7 @@ static int read_balance(struct r1conf *conf, struct r1bio *r1_bio, int *max_sect
/* At least two disks to choose from so failfast is OK */
set_bit(R1BIO_FailFast, &r1_bio->state);
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
dist = abs(this_sector - conf->mirrors[disk].head_position);
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index dfe7d62d3fbdd..7816c8b2e8087 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -796,7 +796,7 @@ static struct md_rdev *read_balance(struct r10conf *conf,
if (!do_balance)
break;
- nonrot = blk_queue_nonrot(bdev_get_queue(rdev->bdev));
+ nonrot = bdev_nonrot(rdev->bdev);
has_nonrot_disk |= nonrot;
pending = atomic_read(&rdev->nr_pending);
if (min_pending > pending && nonrot) {
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 351d341a1ffa4..0bbae0e638666 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7242,7 +7242,7 @@ static struct r5conf *setup_conf(struct mddev *mddev)
rdev_for_each(rdev, mddev) {
if (test_bit(Journal, &rdev->flags))
continue;
- if (blk_queue_nonrot(bdev_get_queue(rdev->bdev))) {
+ if (bdev_nonrot(rdev->bdev)) {
conf->batch_bio_dispatch = false;
break;
}
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c
index 8d191fdc33217..b6ba582b06775 100644
--- a/drivers/target/target_core_file.c
+++ b/drivers/target/target_core_file.c
@@ -135,7 +135,6 @@ static int fd_configure_device(struct se_device *dev)
inode = file->f_mapping->host;
if (S_ISBLK(inode->i_mode)) {
struct block_device *bdev = I_BDEV(inode);
- struct request_queue *q = bdev_get_queue(bdev);
unsigned long long dev_size;
fd_dev->fd_block_size = bdev_logical_block_size(bdev);
@@ -160,7 +159,7 @@ static int fd_configure_device(struct se_device *dev)
*/
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bdev))
dev->dev_attrib.is_nonrot = 1;
} else {
if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) {
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b886ce1770bfd..b41ee5c3b5b82 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -133,7 +133,7 @@ static int iblock_configure_device(struct se_device *dev)
else
dev->dev_attrib.max_write_same_len = 0xFFFF;
- if (blk_queue_nonrot(q))
+ if (bdev_nonrot(bd))
dev->dev_attrib.is_nonrot = 1;
bi = bdev_get_integrity(bd);
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
index 1be7cb2f955fc..1e68674e2cd82 100644
--- a/fs/btrfs/volumes.c
+++ b/fs/btrfs/volumes.c
@@ -643,7 +643,7 @@ static int btrfs_open_one_device(struct btrfs_fs_devices *fs_devices,
set_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
}
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
device->bdev = bdev;
@@ -2715,7 +2715,7 @@ int btrfs_init_new_device(struct btrfs_fs_info *fs_info, const char *device_path
atomic64_add(device->total_bytes, &fs_info->free_chunk_space);
- if (!blk_queue_nonrot(bdev_get_queue(bdev)))
+ if (!bdev_nonrot(bdev))
fs_devices->rotating = true;
orig_super_total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 252c168454c7f..c3668c977cd99 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3498,7 +3498,7 @@ int ext4_mb_init(struct super_block *sb)
spin_lock_init(&lg->lg_prealloc_lock);
}
- if (blk_queue_nonrot(bdev_get_queue(sb->s_bdev)))
+ if (bdev_nonrot(sb->s_bdev))
sbi->s_mb_max_linear_groups = 0;
else
sbi->s_mb_max_linear_groups = MB_DEFAULT_LINEAR_LIMIT;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 60d0161389971..3a9578e14a6b0 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1326,6 +1326,11 @@ static inline unsigned int bdev_write_zeroes_sectors(struct block_device *bdev)
return 0;
}
+static inline bool bdev_nonrot(struct block_device *bdev)
+{
+ return blk_queue_nonrot(bdev_get_queue(bdev));
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index 4c7537162af5e..d5ab7ec4d92ca 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -2466,7 +2466,7 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
if (p->flags & SWP_CONTINUED)
free_swap_count_continuations(p);
- if (!p->bdev || !blk_queue_nonrot(bdev_get_queue(p->bdev)))
+ if (!p->bdev || !bdev_nonrot(p->bdev))
atomic_dec(&nr_rotate_swap);
mutex_lock(&swapon_mutex);
@@ -3071,7 +3071,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
p->flags |= SWP_SYNCHRONOUS_IO;
- if (p->bdev && blk_queue_nonrot(bdev_get_queue(p->bdev))) {
+ if (p->bdev && bdev_nonrot(p->bdev)) {
int cpu;
unsigned long ci, nr_cluster;
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
2022-04-06 6:04 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:16 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 3:16 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:16 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the nonrot flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 10/27] block: add a bdev_nonrot helper
2022-04-06 6:04 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (3 preceding siblings ...)
(?)
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 10/27] block: add a bdev_nonrot helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba via Ocfs2-devel @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:04:59AM +0200, Christoph Hellwig wrote:
> Add a helper to check the nonrot flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> block/ioctl.c | 2 +-
> drivers/block/loop.c | 2 +-
> drivers/md/dm-table.c | 4 +---
> drivers/md/md.c | 3 +--
> drivers/md/raid1.c | 2 +-
> drivers/md/raid10.c | 2 +-
> drivers/md/raid5.c | 2 +-
> drivers/target/target_core_file.c | 3 +--
> drivers/target/target_core_iblock.c | 2 +-
For
> fs/btrfs/volumes.c | 4 ++--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 11/27] block: add a bdev_write_cache helper
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the write cache flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 2 +-
drivers/block/xen-blkback/xenbus.c | 2 +-
drivers/target/target_core_iblock.c | 8 ++------
fs/btrfs/disk-io.c | 3 +--
include/linux/blkdev.h | 5 +++++
5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f04df6294650b..f8cc3c5fecb4b 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -558,7 +558,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->secure_discard =
cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
rsp->cache_policy = 0;
- if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
if (blk_queue_fua(q))
rsp->cache_policy |= RNBD_FUA;
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
index f09040435e2e5..8b691fe50475f 100644
--- a/drivers/block/xen-blkback/xenbus.c
+++ b/drivers/block/xen-blkback/xenbus.c
@@ -517,7 +517,7 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle,
vbd->type |= VDISK_REMOVABLE;
q = bdev_get_queue(bdev);
- if (q && test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(bdev))
vbd->flush_support = true;
if (q && blk_queue_secure_erase(q))
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index b41ee5c3b5b82..03013e85ffc03 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -737,7 +737,7 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
- else if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ else if (!bdev_write_cache(ib_dev->ibd_bd))
opf |= REQ_FUA;
}
} else {
@@ -886,11 +886,7 @@ iblock_parse_cdb(struct se_cmd *cmd)
static bool iblock_get_write_cache(struct se_device *dev)
{
- struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct block_device *bd = ib_dev->ibd_bd;
- struct request_queue *q = bdev_get_queue(bd);
-
- return test_bit(QUEUE_FLAG_WC, &q->queue_flags);
+ return bdev_write_cache(IBLOCK_DEV(dev)->ibd_bd);
}
static const struct target_backend_ops iblock_ops = {
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index b30309f187cf0..d80adee32128d 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -4247,8 +4247,7 @@ static void write_dev_flush(struct btrfs_device *device)
* of simplicity, since this is a debug tool and not meant for use in
* non-debug builds.
*/
- struct request_queue *q = bdev_get_queue(device->bdev);
- if (!test_bit(QUEUE_FLAG_WC, &q->queue_flags))
+ if (bdev_write_cache(device->bdev))
return;
#endif
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 3a9578e14a6b0..807a49aa5a27a 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1331,6 +1331,11 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_write_cache(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:17 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 11/27] block: add a bdev_write_cache helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (3 preceding siblings ...)
(?)
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, dm-devel, linux-xfs, linux-fsdevel, linux-um,
linux-block, drbd-dev, nbd, ceph-devel, virtualization,
xen-devel, linux-bcache, linux-raid, linux-mmc, linux-mtd,
linux-nvme, linux-s390, linux-scsi, target-devel, linux-btrfs,
linux-ext4, linux-f2fs-devel, cluster-devel, jfs-discussion,
linux-nilfs, ntfs3, ocfs2-devel, linux-mm
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 11/27] block: add a bdev_write_cache helper
@ 2022-04-07 15:21 ` David Sterba via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: David Sterba via Ocfs2-devel @ 2022-04-07 15:21 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, Jens Axboe, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
On Wed, Apr 06, 2022 at 08:05:00AM +0200, Christoph Hellwig wrote:
> Add a helper to check the write cache flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/rnbd/rnbd-srv.c | 2 +-
> drivers/block/xen-blkback/xenbus.c | 2 +-
> drivers/target/target_core_iblock.c | 8 ++------
For
> fs/btrfs/disk-io.c | 3 +--
Acked-by: David Sterba <dsterba@suse.com>
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 12/27] block: add a bdev_fua helper
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the FUA flag based on the block_device instead of
having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/rnbd/rnbd-srv.c | 3 +--
drivers/target/target_core_iblock.c | 3 +--
fs/iomap/direct-io.c | 3 +--
include/linux/blkdev.h | 6 +++++-
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rnbd/rnbd-srv.c b/drivers/block/rnbd/rnbd-srv.c
index f8cc3c5fecb4b..beaef43a67b9d 100644
--- a/drivers/block/rnbd/rnbd-srv.c
+++ b/drivers/block/rnbd/rnbd-srv.c
@@ -533,7 +533,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
struct rnbd_srv_sess_dev *sess_dev)
{
struct rnbd_dev *rnbd_dev = sess_dev->rnbd_dev;
- struct request_queue *q = bdev_get_queue(rnbd_dev->bdev);
rsp->hdr.type = cpu_to_le16(RNBD_MSG_OPEN_RSP);
rsp->device_id =
@@ -560,7 +559,7 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
rsp->cache_policy = 0;
if (bdev_write_cache(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_WRITEBACK;
- if (blk_queue_fua(q))
+ if (bdev_fua(rnbd_dev->bdev))
rsp->cache_policy |= RNBD_FUA;
}
diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
index 03013e85ffc03..c4a903b8a47fc 100644
--- a/drivers/target/target_core_iblock.c
+++ b/drivers/target/target_core_iblock.c
@@ -727,14 +727,13 @@ iblock_execute_rw(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents,
if (data_direction == DMA_TO_DEVICE) {
struct iblock_dev *ib_dev = IBLOCK_DEV(dev);
- struct request_queue *q = bdev_get_queue(ib_dev->ibd_bd);
/*
* Force writethrough using REQ_FUA if a volatile write cache
* is not enabled, or if initiator set the Force Unit Access bit.
*/
opf = REQ_OP_WRITE;
miter_dir = SG_MITER_TO_SG;
- if (test_bit(QUEUE_FLAG_FUA, &q->queue_flags)) {
+ if (bdev_fua(ib_dev->ibd_bd)) {
if (cmd->se_cmd_flags & SCF_FUA)
opf |= REQ_FUA;
else if (!bdev_write_cache(ib_dev->ibd_bd))
diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
index b08f5dc31780d..62da020d02a11 100644
--- a/fs/iomap/direct-io.c
+++ b/fs/iomap/direct-io.c
@@ -265,8 +265,7 @@ static loff_t iomap_dio_bio_iter(const struct iomap_iter *iter,
* cache flushes on IO completion.
*/
if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) &&
- (dio->flags & IOMAP_DIO_WRITE_FUA) &&
- blk_queue_fua(bdev_get_queue(iomap->bdev)))
+ (dio->flags & IOMAP_DIO_WRITE_FUA) && bdev_fua(iomap->bdev))
use_fua = true;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 807a49aa5a27a..075b16d4560e7 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -602,7 +602,6 @@ bool blk_queue_flag_test_and_set(unsigned int flag, struct request_queue *q);
REQ_FAILFAST_DRIVER))
#define blk_queue_quiesced(q) test_bit(QUEUE_FLAG_QUIESCED, &(q)->queue_flags)
#define blk_queue_pm_only(q) atomic_read(&(q)->pm_only)
-#define blk_queue_fua(q) test_bit(QUEUE_FLAG_FUA, &(q)->queue_flags)
#define blk_queue_registered(q) test_bit(QUEUE_FLAG_REGISTERED, &(q)->queue_flags)
#define blk_queue_nowait(q) test_bit(QUEUE_FLAG_NOWAIT, &(q)->queue_flags)
@@ -1336,6 +1335,11 @@ static inline bool bdev_write_cache(struct block_device *bdev)
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
}
+static inline bool bdev_fua(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_FUA, &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline enum blk_zoned_model bdev_zoned_model(struct block_device *bdev)
{
struct request_queue *q = bdev_get_queue(bdev);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:17 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 12/27] block: add a bdev_fua helper
@ 2022-04-07 3:17 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:17 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the FUA flag based on the block_device instead
> of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 13/27] block: add a bdev_stable_writes helper
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the stable writes flag based on the block_device
instead of having to poke into the block layer internal request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/md/dm-table.c | 4 +---
fs/super.c | 2 +-
include/linux/blkdev.h | 6 ++++++
mm/swapfile.c | 2 +-
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 5e38d0dd009d5..d46839faa0ca5 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1950,9 +1950,7 @@ static int device_requires_stable_pages(struct dm_target *ti,
struct dm_dev *dev, sector_t start,
sector_t len, void *data)
{
- struct request_queue *q = bdev_get_queue(dev->bdev);
-
- return blk_queue_stable_writes(q);
+ return bdev_stable_writes(dev->bdev);
}
int dm_table_set_restrictions(struct dm_table *t, struct request_queue *q,
diff --git a/fs/super.c b/fs/super.c
index f1d4a193602d6..60f57c7bc0a69 100644
--- a/fs/super.c
+++ b/fs/super.c
@@ -1204,7 +1204,7 @@ static int set_bdev_super(struct super_block *s, void *data)
s->s_dev = s->s_bdev->bd_dev;
s->s_bdi = bdi_get(s->s_bdev->bd_disk->bdi);
- if (blk_queue_stable_writes(s->s_bdev->bd_disk->queue))
+ if (bdev_stable_writes(s->s_bdev))
s->s_iflags |= SB_I_STABLE_WRITES;
return 0;
}
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 075b16d4560e7..a433798c3343e 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1330,6 +1330,12 @@ static inline bool bdev_nonrot(struct block_device *bdev)
return blk_queue_nonrot(bdev_get_queue(bdev));
}
+static inline bool bdev_stable_writes(struct block_device *bdev)
+{
+ return test_bit(QUEUE_FLAG_STABLE_WRITES,
+ &bdev_get_queue(bdev)->queue_flags);
+}
+
static inline bool bdev_write_cache(struct block_device *bdev)
{
return test_bit(QUEUE_FLAG_WC, &bdev_get_queue(bdev)->queue_flags);
diff --git a/mm/swapfile.c b/mm/swapfile.c
index d5ab7ec4d92ca..4069f17a82c8e 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -3065,7 +3065,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
goto bad_swap_unlock_inode;
}
- if (p->bdev && blk_queue_stable_writes(p->bdev->bd_disk->queue))
+ if (p->bdev && bdev_stable_writes(p->bdev))
p->flags |= SWP_STABLE_WRITES;
if (p->bdev && p->bdev->bd_disk->fops->rw_page)
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 13/27] block: add a bdev_stable_writes helper
@ 2022-04-07 3:18 ` Martin K. Petersen via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:18 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Add a helper to check the stable writes flag based on the block_device
> instead of having to poke into the block layer internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Add a helper to check the max supported sectors for zone append based on
the block_device instead of having to poke into the block layer internal
request_queue.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/nvme/target/zns.c | 3 +--
fs/zonefs/super.c | 3 +--
include/linux/blkdev.h | 6 ++++++
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
index e34718b095504..82b61acf7a72b 100644
--- a/drivers/nvme/target/zns.c
+++ b/drivers/nvme/target/zns.c
@@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
{
- struct request_queue *q = ns->bdev->bd_disk->queue;
- u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
+ u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
struct gendisk *bd_disk = ns->bdev->bd_disk;
int ret;
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index 3614c7834007d..7a63807b736c4 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
struct inode *inode = file_inode(iocb->ki_filp);
struct zonefs_inode_info *zi = ZONEFS_I(inode);
struct block_device *bdev = inode->i_sb->s_bdev;
- unsigned int max;
+ unsigned int max = bdev_max_zone_append_sectors(bdev);
struct bio *bio;
ssize_t size;
int nr_pages;
ssize_t ret;
- max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
iov_iter_truncate(from, max);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a433798c3343e..f8c50b77543eb 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
return min(l->max_zone_append_sectors, l->max_sectors);
}
+static inline unsigned int
+bdev_max_zone_append_sectors(struct block_device *bdev)
+{
+ return queue_max_zone_append_sectors(bdev_get_queue(bdev));
+}
+
static inline unsigned queue_logical_block_size(const struct request_queue *q)
{
int retval = 512;
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (2 preceding siblings ...)
(?)
@ 2022-04-06 8:52 ` Damien Le Moal
-1 siblings, 0 replies; 455+ messages in thread
From: Damien Le Moal @ 2022-04-06 8:52 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
On 4/6/22 15:05, Christoph Hellwig wrote:
> Add a helper to check the max supported sectors for zone append based on
> the block_device instead of having to poke into the block layer internal
> request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/zns.c | 3 +--
> fs/zonefs/super.c | 3 +--
> include/linux/blkdev.h | 6 ++++++
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b095504..82b61acf7a72b 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
>
> bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
> {
> - struct request_queue *q = ns->bdev->bd_disk->queue;
> - u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
> + u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
> struct gendisk *bd_disk = ns->bdev->bd_disk;
> int ret;
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 3614c7834007d..7a63807b736c4 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> - unsigned int max;
> + unsigned int max = bdev_max_zone_append_sectors(bdev);
> struct bio *bio;
> ssize_t size;
> int nr_pages;
> ssize_t ret;
>
> - max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> iov_iter_truncate(from, max);
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a433798c3343e..f8c50b77543eb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
> return min(l->max_zone_append_sectors, l->max_sectors);
> }
>
> +static inline unsigned int
> +bdev_max_zone_append_sectors(struct block_device *bdev)
> +{
> + return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +}
> +
> static inline unsigned queue_logical_block_size(const struct request_queue *q)
> {
> int retval = 512;
Looks good.
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 8:52 ` Damien Le Moal
0 siblings, 0 replies; 455+ messages in thread
From: Damien Le Moal @ 2022-04-06 8:52 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
On 4/6/22 15:05, Christoph Hellwig wrote:
> Add a helper to check the max supported sectors for zone append based on
> the block_device instead of having to poke into the block layer internal
> request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/zns.c | 3 +--
> fs/zonefs/super.c | 3 +--
> include/linux/blkdev.h | 6 ++++++
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b095504..82b61acf7a72b 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
>
> bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
> {
> - struct request_queue *q = ns->bdev->bd_disk->queue;
> - u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
> + u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
> struct gendisk *bd_disk = ns->bdev->bd_disk;
> int ret;
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 3614c7834007d..7a63807b736c4 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> - unsigned int max;
> + unsigned int max = bdev_max_zone_append_sectors(bdev);
> struct bio *bio;
> ssize_t size;
> int nr_pages;
> ssize_t ret;
>
> - max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> iov_iter_truncate(from, max);
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a433798c3343e..f8c50b77543eb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
> return min(l->max_zone_append_sectors, l->max_sectors);
> }
>
> +static inline unsigned int
> +bdev_max_zone_append_sectors(struct block_device *bdev)
> +{
> + return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +}
> +
> static inline unsigned queue_logical_block_size(const struct request_queue *q)
> {
> int retval = 512;
Looks good.
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 8:52 ` Damien Le Moal
0 siblings, 0 replies; 455+ messages in thread
From: Damien Le Moal via Linux-f2fs-devel @ 2022-04-06 8:52 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
On 4/6/22 15:05, Christoph Hellwig wrote:
> Add a helper to check the max supported sectors for zone append based on
> the block_device instead of having to poke into the block layer internal
> request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/zns.c | 3 +--
> fs/zonefs/super.c | 3 +--
> include/linux/blkdev.h | 6 ++++++
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b095504..82b61acf7a72b 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
>
> bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
> {
> - struct request_queue *q = ns->bdev->bd_disk->queue;
> - u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
> + u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
> struct gendisk *bd_disk = ns->bdev->bd_disk;
> int ret;
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 3614c7834007d..7a63807b736c4 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> - unsigned int max;
> + unsigned int max = bdev_max_zone_append_sectors(bdev);
> struct bio *bio;
> ssize_t size;
> int nr_pages;
> ssize_t ret;
>
> - max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> iov_iter_truncate(from, max);
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a433798c3343e..f8c50b77543eb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
> return min(l->max_zone_append_sectors, l->max_sectors);
> }
>
> +static inline unsigned int
> +bdev_max_zone_append_sectors(struct block_device *bdev)
> +{
> + return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +}
> +
> static inline unsigned queue_logical_block_size(const struct request_queue *q)
> {
> int retval = 512;
Looks good.
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 8:52 ` Damien Le Moal
0 siblings, 0 replies; 455+ messages in thread
From: Damien Le Moal @ 2022-04-06 8:52 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
On 4/6/22 15:05, Christoph Hellwig wrote:
> Add a helper to check the max supported sectors for zone append based on
> the block_device instead of having to poke into the block layer internal
> request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/zns.c | 3 +--
> fs/zonefs/super.c | 3 +--
> include/linux/blkdev.h | 6 ++++++
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b095504..82b61acf7a72b 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
>
> bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
> {
> - struct request_queue *q = ns->bdev->bd_disk->queue;
> - u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
> + u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
> struct gendisk *bd_disk = ns->bdev->bd_disk;
> int ret;
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 3614c7834007d..7a63807b736c4 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> - unsigned int max;
> + unsigned int max = bdev_max_zone_append_sectors(bdev);
> struct bio *bio;
> ssize_t size;
> int nr_pages;
> ssize_t ret;
>
> - max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> iov_iter_truncate(from, max);
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a433798c3343e..f8c50b77543eb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
> return min(l->max_zone_append_sectors, l->max_sectors);
> }
>
> +static inline unsigned int
> +bdev_max_zone_append_sectors(struct block_device *bdev)
> +{
> + return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +}
> +
> static inline unsigned queue_logical_block_size(const struct request_queue *q)
> {
> int retval = 512;
Looks good.
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 8:52 ` Damien Le Moal
0 siblings, 0 replies; 455+ messages in thread
From: Damien Le Moal @ 2022-04-06 8:52 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
On 4/6/22 15:05, Christoph Hellwig wrote:
> Add a helper to check the max supported sectors for zone append based on
> the block_device instead of having to poke into the block layer internal
> request_queue.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/nvme/target/zns.c | 3 +--
> fs/zonefs/super.c | 3 +--
> include/linux/blkdev.h | 6 ++++++
> 3 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/nvme/target/zns.c b/drivers/nvme/target/zns.c
> index e34718b095504..82b61acf7a72b 100644
> --- a/drivers/nvme/target/zns.c
> +++ b/drivers/nvme/target/zns.c
> @@ -34,8 +34,7 @@ static int validate_conv_zones_cb(struct blk_zone *z,
>
> bool nvmet_bdev_zns_enable(struct nvmet_ns *ns)
> {
> - struct request_queue *q = ns->bdev->bd_disk->queue;
> - u8 zasl = nvmet_zasl(queue_max_zone_append_sectors(q));
> + u8 zasl = nvmet_zasl(bdev_max_zone_append_sectors(ns->bdev));
> struct gendisk *bd_disk = ns->bdev->bd_disk;
> int ret;
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index 3614c7834007d..7a63807b736c4 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -678,13 +678,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> - unsigned int max;
> + unsigned int max = bdev_max_zone_append_sectors(bdev);
> struct bio *bio;
> ssize_t size;
> int nr_pages;
> ssize_t ret;
>
> - max = queue_max_zone_append_sectors(bdev_get_queue(bdev));
> max = ALIGN_DOWN(max << SECTOR_SHIFT, inode->i_sb->s_blocksize);
> iov_iter_truncate(from, max);
>
> diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
> index a433798c3343e..f8c50b77543eb 100644
> --- a/include/linux/blkdev.h
> +++ b/include/linux/blkdev.h
> @@ -1188,6 +1188,12 @@ static inline unsigned int queue_max_zone_append_sectors(const struct request_qu
> return min(l->max_zone_append_sectors, l->max_sectors);
> }
>
> +static inline unsigned int
> +bdev_max_zone_append_sectors(struct block_device *bdev)
> +{
> + return queue_max_zone_append_sectors(bdev_get_queue(bdev));
> +}
> +
> static inline unsigned queue_logical_block_size(const struct request_queue *q)
> {
> int retval = 512;
Looks good.
Acked-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
--
Damien Le Moal
Western Digital Research
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (2 preceding siblings ...)
(?)
@ 2022-04-06 9:58 ` Johannes Thumshirn
-1 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn via Ocfs2-devel @ 2022-04-06 9:58 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 9:58 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn via Linux-f2fs-devel @ 2022-04-06 9:58 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 9:58 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:58 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 9:58 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:58 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-06 9:58 ` Johannes Thumshirn
0 siblings, 0 replies; 455+ messages in thread
From: Johannes Thumshirn @ 2022-04-06 9:58 UTC (permalink / raw)
To: Christoph Hellwig, Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:15 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-btrfs,
linux-fsdevel, ntfs3, ocfs2-devel
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [PATCH 14/27] block: add a bdev_max_zone_append_sectors helper
@ 2022-04-07 3:15 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:15 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Jens Axboe, jfs-discussion, linux-nvme, virtualization, linux-mm,
dm-devel, target-devel, linux-mtd, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-block, linux-bcache, ceph-devel, linux-raid,
linux-mmc, linux-f2fs-devel, linux-xfs, ocfs2-devel,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Add a helper to check the max supported sectors for zone append based
> on the block_device instead of having to poke into the block layer
> internal request_queue.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Replace the open coded offset calculation with the proper helper.
This is an ABI change in that the -1 for a misaligned partition is
properly propagated, which can be considered a bug fix and maches
what is done on the whole device.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/partitions/core.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/block/partitions/core.c b/block/partitions/core.c
index 2ef8dfa1e5c85..240b3fff521e4 100644
--- a/block/partitions/core.c
+++ b/block/partitions/core.c
@@ -200,11 +200,7 @@ static ssize_t part_ro_show(struct device *dev,
static ssize_t part_alignment_offset_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
- struct block_device *bdev = dev_to_bdev(dev);
-
- return sprintf(buf, "%u\n",
- queue_limit_alignment_offset(&bdev_get_queue(bdev)->limits,
- bdev->bd_start_sect));
+ return sprintf(buf, "%u\n", bdev_alignment_offset(dev_to_bdev(dev)));
}
static ssize_t part_discard_alignment_show(struct device *dev,
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:19 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 15/27] block: use bdev_alignment_offset in part_alignment_offset_show
@ 2022-04-07 3:19 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:19 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Replace the open coded offset calculation with the proper helper.
> This is an ABI change in that the -1 for a misaligned partition is
> properly propagated, which can be considered a bug fix and maches what
> is done on the whole device.
Looks good.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
The bdev version does the right thing for partitions, so use that.
Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/drbd/drbd_main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index d20d84ee7a88e..9d43aadde19ad 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
p->qlim->logical_block_size =
cpu_to_be32(bdev_logical_block_size(bdev));
p->qlim->alignment_offset =
- cpu_to_be32(queue_alignment_offset(q));
+ cpu_to_be32(bdev_alignment_offset(bdev));
p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
p->qlim->discard_enabled = blk_queue_discard(q);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Drbd-dev] [PATCH 16/27] drbd: use bdev_alignment_offset instead of queue_alignment_offset
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (5 preceding siblings ...)
(?)
@ 2022-04-06 9:32 ` Christoph Böhmwalder
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Böhmwalder @ 2022-04-06 9:32 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: drbd-dev, linux-block, Jens Axboe
Am 06.04.22 um 08:05 schrieb Christoph Hellwig:
> The bdev version does the right thing for partitions, so use that.
>
> Fixes: 9104d31a759f ("drbd: introduce WRITE_SAME support")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/drbd/drbd_main.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
> index d20d84ee7a88e..9d43aadde19ad 100644
> --- a/drivers/block/drbd/drbd_main.c
> +++ b/drivers/block/drbd/drbd_main.c
> @@ -939,7 +939,7 @@ int drbd_send_sizes(struct drbd_peer_device *peer_device, int trigger_reply, enu
> p->qlim->logical_block_size =
> cpu_to_be32(bdev_logical_block_size(bdev));
> p->qlim->alignment_offset =
> - cpu_to_be32(queue_alignment_offset(q));
> + cpu_to_be32(bdev_alignment_offset(bdev));
> p->qlim->io_min = cpu_to_be32(bdev_io_min(bdev));
> p->qlim->io_opt = cpu_to_be32(bdev_io_opt(bdev));
> p->qlim->discard_enabled = blk_queue_discard(q);
Acked-by: Christoph Böhmwalder <christoph.boehmwalder@linbit.com>
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
This does the same as the open coded variant except for an extra branch,
and allows to remove queue_alignment_offset entirely.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index b8b6759d670f0..712031ce19070 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1010,7 +1010,7 @@ static ssize_t disk_alignment_offset_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_alignment_offset(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t disk_discard_alignment_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index f8c50b77543eb..d5346e72e3645 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,14 +1251,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_alignment_offset(const struct request_queue *q)
-{
- if (q->limits.misaligned)
- return -1;
-
- return q->limits.alignment_offset;
-}
-
static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
{
unsigned int granularity = max(lim->physical_block_size, lim->io_min);
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:20 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 17/27] block: use bdev_alignment_offset in disk_alignment_offset_show
@ 2022-04-07 3:20 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:20 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> This does the same as the open coded variant except for an extra
> branch, and allows to remove queue_alignment_offset entirely.
Also fine.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
No need to inline these fairly larger helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/blk-settings.c | 23 +++++++++++++++++++++++
include/linux/blkdev.h | 21 +--------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/block/blk-settings.c b/block/blk-settings.c
index b83df3d2eebca..94410a13c0dee 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -468,6 +468,16 @@ void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
}
EXPORT_SYMBOL(blk_queue_io_opt);
+static int queue_limit_alignment_offset(struct queue_limits *lim,
+ sector_t sector)
+{
+ unsigned int granularity = max(lim->physical_block_size, lim->io_min);
+ unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
+ << SECTOR_SHIFT;
+
+ return (granularity + lim->alignment_offset - alignment) % granularity;
+}
+
static unsigned int blk_round_down_sectors(unsigned int sectors, unsigned int lbs)
{
sectors = round_down(sectors, lbs >> SECTOR_SHIFT);
@@ -901,3 +911,16 @@ void blk_queue_set_zoned(struct gendisk *disk, enum blk_zoned_model model)
}
}
EXPORT_SYMBOL_GPL(blk_queue_set_zoned);
+
+int bdev_alignment_offset(struct block_device *bdev)
+{
+ struct request_queue *q = bdev_get_queue(bdev);
+
+ if (q->limits.misaligned)
+ return -1;
+ if (bdev_is_partition(bdev))
+ return queue_limit_alignment_offset(&q->limits,
+ bdev->bd_start_sect);
+ return q->limits.alignment_offset;
+}
+EXPORT_SYMBOL_GPL(bdev_alignment_offset);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d5346e72e3645..0a1795ac26275 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1251,26 +1251,7 @@ bdev_zone_write_granularity(struct block_device *bdev)
return queue_zone_write_granularity(bdev_get_queue(bdev));
}
-static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector)
-{
- unsigned int granularity = max(lim->physical_block_size, lim->io_min);
- unsigned int alignment = sector_div(sector, granularity >> SECTOR_SHIFT)
- << SECTOR_SHIFT;
-
- return (granularity + lim->alignment_offset - alignment) % granularity;
-}
-
-static inline int bdev_alignment_offset(struct block_device *bdev)
-{
- struct request_queue *q = bdev_get_queue(bdev);
-
- if (q->limits.misaligned)
- return -1;
- if (bdev_is_partition(bdev))
- return queue_limit_alignment_offset(&q->limits,
- bdev->bd_start_sect);
- return q->limits.alignment_offset;
-}
+int bdev_alignment_offset(struct block_device *bdev);
static inline int queue_discard_alignment(const struct request_queue *q)
{
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:21 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [f2fs-dev] [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 18/27] block: move bdev_alignment_offset and queue_limit_alignment_offset out of line
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> No need to inline these fairly larger helpers.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 455+ messages in thread
* [PATCH 19/27] block: remove queue_discard_alignment
2022-04-06 6:04 ` [f2fs-dev] " Christoph Hellwig
` (4 preceding siblings ...)
(?)
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
-1 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: dm-devel, linux-xfs, linux-fsdevel, linux-um, linux-block,
drbd-dev, nbd, ceph-devel, virtualization, xen-devel,
linux-bcache, linux-raid, linux-mmc, linux-mtd, linux-nvme,
linux-s390, linux-scsi, target-devel, linux-btrfs, linux-ext4,
linux-f2fs-devel, cluster-devel, jfs-discussion, linux-nilfs,
ntfs3, ocfs2-devel, linux-mm
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [dm-devel] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [f2fs-dev] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-06 6:05 ` Christoph Hellwig via Ocfs2-devel
0 siblings, 0 replies; 455+ messages in thread
From: Christoph Hellwig via Ocfs2-devel @ 2022-04-06 6:05 UTC (permalink / raw)
To: Jens Axboe
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-block, linux-bcache, ceph-devel, linux-raid, linux-mmc,
linux-f2fs-devel, linux-xfs, ocfs2-devel, linux-fsdevel, ntfs3,
linux-btrfs
Just use bdev_alignment_offset in disk_discard_alignment_show instead.
That helpers is the same except for an always false branch that doesn't
matter in this slow path.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
block/genhd.c | 2 +-
include/linux/blkdev.h | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/block/genhd.c b/block/genhd.c
index 712031ce19070..36532b9318419 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1019,7 +1019,7 @@ static ssize_t disk_discard_alignment_show(struct device *dev,
{
struct gendisk *disk = dev_to_disk(dev);
- return sprintf(buf, "%d\n", queue_discard_alignment(disk->queue));
+ return sprintf(buf, "%d\n", bdev_alignment_offset(disk->part0));
}
static ssize_t diskseq_show(struct device *dev,
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0a1795ac26275..5a9b7aeda010b 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1253,14 +1253,6 @@ bdev_zone_write_granularity(struct block_device *bdev)
int bdev_alignment_offset(struct block_device *bdev);
-static inline int queue_discard_alignment(const struct request_queue *q)
-{
- if (q->limits.discard_misaligned)
- return -1;
-
- return q->limits.discard_alignment;
-}
-
static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector)
{
unsigned int alignment, granularity, offset;
--
2.30.2
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply related [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment
2022-04-06 6:05 ` [Ocfs2-devel] " Christoph Hellwig via Ocfs2-devel
` (4 preceding siblings ...)
(?)
@ 2022-04-07 3:21 ` Martin K. Petersen
-1 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen via Ocfs2-devel @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, drbd-dev, linux-s390, linux-nilfs,
linux-scsi, cluster-devel, xen-devel, linux-ext4, linux-um, nbd,
linux-raid, linux-bcache, ceph-devel, Jens Axboe, linux-block,
linux-mmc, linux-f2fs-devel, linux-xfs, linux-fsdevel, ntfs3,
linux-btrfs
Christoph,
> Just use bdev_alignment_offset in disk_discard_alignment_show instead.
> That helpers is the same except for an always false branch that
> doesn't matter in this slow path.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Just use bdev_alignment_offset in disk_discard_alignment_show instead.
> That helpers is the same except for an always false branch that
> doesn't matter in this slow path.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: Jens Axboe, Christoph Hellwig, jfs-discussion, linux-nvme,
virtualization, linux-mm, dm-devel, target-devel, linux-mtd,
drbd-dev, linux-s390, linux-nilfs, linux-scsi, cluster-devel,
xen-devel, linux-ext4, linux-um, nbd, linux-block, linux-bcache,
ceph-devel, linux-raid, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,
> Just use bdev_alignment_offset in disk_discard_alignment_show instead.
> That helpers is the same except for an always false branch that
> doesn't matter in this slow path.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 455+ messages in thread
* Re: [dm-devel] [Ocfs2-devel] [PATCH 19/27] block: remove queue_discard_alignment
@ 2022-04-07 3:21 ` Martin K. Petersen
0 siblings, 0 replies; 455+ messages in thread
From: Martin K. Petersen @ 2022-04-07 3:21 UTC (permalink / raw)
To: Christoph Hellwig via Ocfs2-devel
Cc: jfs-discussion, linux-nvme, virtualization, linux-mm, dm-devel,
target-devel, linux-mtd, Christoph Hellwig, drbd-dev, linux-s390,
linux-nilfs, linux-scsi, cluster-devel, xen-devel, linux-ext4,
linux-um, nbd, linux-raid, linux-bcache, ceph-devel, Jens Axboe,
linux-block, linux-mmc, linux-f2fs-devel, linux-xfs,
linux-fsdevel, ntfs3, linux-btrfs
Christoph,