summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--block/elevator.c6
-rw-r--r--block/genhd.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/block/elevator.c b/block/elevator.c
index a842e4b8ebc6..20a4e7c7c774 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -192,6 +192,9 @@ void elevator_exit(struct request_queue *q)
{
struct elevator_queue *e = q->elevator;
+ ioc_clear_queue(q);
+ blk_mq_sched_free_rqs(q);
+
mutex_lock(&e->sysfs_lock);
blk_mq_exit_sched(q, e);
mutex_unlock(&e->sysfs_lock);
@@ -596,8 +599,6 @@ int elevator_switch_mq(struct request_queue *q,
if (q->elevator) {
elv_unregister_queue(q);
- ioc_clear_queue(q);
- blk_mq_sched_free_rqs(q);
elevator_exit(q);
}
@@ -608,7 +609,6 @@ 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);
goto out;
}
diff --git a/block/genhd.c b/block/genhd.c
index 73705a749ea9..857e0a54da7d 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -1115,10 +1115,7 @@ static void disk_release_mq(struct request_queue *q)
* cgroup controller.
*/
if (q->elevator) {
- ioc_clear_queue(q);
-
mutex_lock(&q->sysfs_lock);
- blk_mq_sched_free_rqs(q);
elevator_exit(q);
mutex_unlock(&q->sysfs_lock);
}