From f46b81c54b241bf1ec01c8936a37201c99f94fc7 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Tue, 23 Nov 2021 19:53:06 +0100 Subject: block: remove elevator_exit Open code elevator_exit in it's only caller, and rename __elevator_exit to elevator_exit. Signed-off-by: Christoph Hellwig Link: https://lore.kernel.org/r/20211123185312.1432157-3-hch@lst.de Signed-off-by: Jens Axboe --- block/elevator.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'block/elevator.c') diff --git a/block/elevator.c b/block/elevator.c index 19a78d5516ba..3536cdd5fa12 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -188,7 +188,7 @@ static void elevator_release(struct kobject *kobj) kfree(e); } -void __elevator_exit(struct request_queue *q, struct elevator_queue *e) +void elevator_exit(struct request_queue *q, struct elevator_queue *e) { mutex_lock(&e->sysfs_lock); blk_mq_exit_sched(q, e); @@ -595,6 +595,7 @@ int elevator_switch_mq(struct request_queue *q, elv_unregister_queue(q); ioc_clear_queue(q); + blk_mq_sched_free_rqs(q); elevator_exit(q, q->elevator); } @@ -605,6 +606,7 @@ int elevator_switch_mq(struct request_queue *q, if (new_e) { ret = elv_register_queue(q, true); if (ret) { + blk_mq_sched_free_rqs(q); elevator_exit(q, q->elevator); goto out; } -- cgit v1.2.3