Skip to content

Commit 2930662

Browse files
Christoph Hellwigmartinkpetersen
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Kanchan Joshi <[email protected]> Reviewed-by: Damien Le Moal <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Reviewed-by: John Garry <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 28fc2bd commit 2930662

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

include/linux/blkdev.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,19 @@ int queue_limits_commit_update(struct request_queue *q,
892892
struct queue_limits *lim);
893893
int queue_limits_set(struct request_queue *q, struct queue_limits *lim);
894894

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+
895908
/*
896909
* Access functions for manipulating queue properties
897910
*/

0 commit comments

Comments
 (0)