]> 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>
Fri, 31 May 2024 07:48:09 +0000 (09:48 +0200)
committerJens Axboe <axboe@kernel.dk>
Fri, 14 Jun 2024 16:19:44 +0000 (10:19 -0600)
commit73e3715ed14844067c5c598e72777641004a7f60
tree1dfc2856f39e2b782bf860b1f000bd321d12fdfb
parent1652b0bafeaa8281ca9a805d81e13d7647bd2f44
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>
Reviewed-by: John Garry <john.g.garry@oracle.com>
Reviewed-by: Nitesh Shetty <nj.shetty@samsung.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20240531074837.1648501-15-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
arch/um/drivers/ubd_kern.c
block/blk-settings.c
drivers/block/xen-blkfront.c
drivers/scsi/sd.c
include/linux/blkdev.h