]> www.infradead.org Git - users/hch/block.git/commit
block: move cache control settings out of queue->flags
authorChristoph Hellwig <hch@lst.de>
Fri, 14 Jun 2024 04:19:40 +0000 (06:19 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 17 Jun 2024 06:03:13 +0000 (08:03 +0200)
commit0a4b93029038dad9000f8a78fddb26c39942642c
tree690fcda48991904d6916c6f6e0f2205e37511531
parent8571bebe2c969f06c2ed02c149a1a226da79500c
block: move cache control settings out of queue->flags

Move the cache control settings into the queue_limits so that the flags
can be set atomically with the device queue frozen.

Add new features and flags field for the driver set flags, and internal
(usually sysfs-controlled) flags in the block layer.  Note that we'll
eventually remove enough field from queue_limits to bring it back to the
previous size.

The disable flag is inverted compared to the previous meaning, which
means it now survives a rescan, similar to the max_sectors and
max_discard_sectors user limits.

The FLUSH and FUA flags are now inherited by blk_stack_limits, which
simplified the code in dm a lot, but also causes a slight behavior
change in that dm-switch and dm-unstripe now advertise a write cache
despite setting num_flush_bios to 0.  The I/O path will handle this
gracefully, but as far as I can tell the lack of num_flush_bios
and thus flush support is a pre-existing data integrity bug in those
targets that really needs fixing, after which a non-zero num_flush_bios
should be required in dm for targets that map to underlying devices.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Ulf Hansson <ulf.hansson@linaro.org> [mmc]
29 files changed:
Documentation/block/writeback_cache_control.rst
arch/um/drivers/ubd_kern.c
block/blk-core.c
block/blk-flush.c
block/blk-mq-debugfs.c
block/blk-settings.c
block/blk-sysfs.c
block/blk-wbt.c
drivers/block/drbd/drbd_main.c
drivers/block/loop.c
drivers/block/nbd.c
drivers/block/null_blk/main.c
drivers/block/ps3disk.c
drivers/block/rnbd/rnbd-clt.c
drivers/block/ublk_drv.c
drivers/block/virtio_blk.c
drivers/block/xen-blkfront.c
drivers/md/bcache/super.c
drivers/md/dm-table.c
drivers/md/md.c
drivers/mmc/core/block.c
drivers/mmc/core/queue.c
drivers/mmc/core/queue.h
drivers/mtd/mtd_blkdevs.c
drivers/nvdimm/pmem.c
drivers/nvme/host/core.c
drivers/nvme/host/multipath.c
drivers/scsi/sd.c
include/linux/blkdev.h