summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-04-09 17:37:26 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2024-04-12 04:37:48 +0300
commit293066264fb45df4290897c22e69833bea5fe171 (patch)
treeb0b06277105930a307e89404c4d288e2751d6c24
parent28fc2bd2c7298d647fcbab7b11532a1f5fda7470 (diff)
downloadlinux-293066264fb45df4290897c22e69833bea5fe171.tar.xz
scsi: block: Add a helper to cancel atomic queue limit updates
Drivers might have to perform complex actions to determine queue limits, and those might fail. Add a helper to cancel a queue limit update that can be called in those cases. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20240409143748.980206-2-hch@lst.de Reviewed-by: Kanchan Joshi <joshi.k@samsung.com> Reviewed-by: Damien Le Moal <dlemoal@kernel.org> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: John Garry <john.g.garry@oracle.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r--include/linux/blkdev.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index c3e8f7cf96be..ded7f66dc4b9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -892,6 +892,19 @@ int queue_limits_commit_update(struct request_queue *q,
struct queue_limits *lim);
int queue_limits_set(struct request_queue *q, struct queue_limits *lim);
+/**
+ * queue_limits_cancel_update - cancel an atomic update of queue limits
+ * @q: queue to update
+ *
+ * This functions cancels an atomic update of the queue limits started by
+ * queue_limits_start_update() and should be used when an error occurs after
+ * starting update.
+ */
+static inline void queue_limits_cancel_update(struct request_queue *q)
+{
+ mutex_unlock(&q->limits_lock);
+}
+
/*
* Access functions for manipulating queue properties
*/