]> www.infradead.org Git - users/hch/block.git/commit
block: add special APIs for run-time disabling of discard and friends
authorChristoph Hellwig <hch@lst.de>
Thu, 30 May 2024 06:37:46 +0000 (08:37 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 31 May 2024 07:29:24 +0000 (09:29 +0200)
commita7a98f4da8861f9aeee5cf303b911ba7899ef8c5
tree001c3b2af72295cff551952ecf1b6ce4e26a1cbf
parentdee7d8d49ca257ccbb2b0a7d179a393aba28d8c8
block: add special APIs for run-time disabling of discard and friends

A few drivers optimistically try to support discard, write zeroes and
secure erase and disable the features from the I/O completion handler
if the hardware can't support them.  This disable can't be done using
the atomic queue limits API because the I/O completion handlers can't
take sleeping locks or freeze the queue.  Keep the existing clearing
of the relevant field to zero, but replace the old blk_queue_max_*
APIs with new disable APIs that force the value to 0.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
arch/um/drivers/ubd_kern.c
block/blk-settings.c
drivers/block/xen-blkfront.c
drivers/scsi/sd.c
include/linux/blkdev.h