Add non_owner variant of blk_mq_freeze_queue API for rbd. Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> --- block/blk-mq.c | 14 +++++++++++--- include/linux/blk-mq.h | 1 + 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 5f4496220432..8e18284ede8f 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -195,12 +195,20 @@ void blk_mq_unfreeze_queue(struct request_queue *q) EXPORT_SYMBOL_GPL(blk_mq_unfreeze_queue); /* - * non_owner variant of blk_freeze_queue_start + * non_owner variant of blk_mq_freeze_queue * - * Unlike blk_freeze_queue_start, the queue doesn't need to be unfrozen - * by the same task. This is fragile and should not be used if at all + * Unlike blk_mq_freeze_queue, the queue doesn't need to be unfrozen by + * the same task. This is fragile and should not be used if at all * possible. */ +void blk_mq_freeze_queue_non_owner(struct request_queue *q) +{ + __blk_freeze_queue_start(q); + blk_mq_freeze_queue_wait(q); +} +EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_non_owner); + +/* non_owner variant of blk_freeze_queue_start */ void blk_freeze_queue_start_non_owner(struct request_queue *q) { __blk_freeze_queue_start(q); diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 2035fad3131f..ed15dc2e7bd6 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -919,6 +919,7 @@ void blk_freeze_queue_start(struct request_queue *q); void blk_mq_freeze_queue_wait(struct request_queue *q); int blk_mq_freeze_queue_wait_timeout(struct request_queue *q, unsigned long timeout); +void blk_mq_freeze_queue_non_owner(struct request_queue *q); void blk_mq_unfreeze_queue_non_owner(struct request_queue *q); void blk_freeze_queue_start_non_owner(struct request_queue *q); -- 2.47.0