Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Christoph Hellwig and committed by
Martin K. Petersen
29306626 28fc2bd2

+13
+13
include/linux/blkdev.h
··· 892 892 struct queue_limits *lim); 893 893 int queue_limits_set(struct request_queue *q, struct queue_limits *lim); 894 894 895 + /** 896 + * queue_limits_cancel_update - cancel an atomic update of queue limits 897 + * @q: queue to update 898 + * 899 + * This functions cancels an atomic update of the queue limits started by 900 + * queue_limits_start_update() and should be used when an error occurs after 901 + * starting update. 902 + */ 903 + static inline void queue_limits_cancel_update(struct request_queue *q) 904 + { 905 + mutex_unlock(&q->limits_lock); 906 + } 907 + 895 908 /* 896 909 * Access functions for manipulating queue properties 897 910 */