提交 dd1c372d 编写于 作者: Y Yufen Yu 提交者: Jens Axboe

block: invoke blk_mq_exit_sched no matter whether have .exit_sched

We will register debugfs for scheduler no matter whether it have
defined callback funciton .exit_sched. So, blk_mq_exit_sched()
is always needed to unregister debugfs. Also, q->elevator should
be set as NULL after exiting scheduler.

For now, since all register scheduler have defined .exit_sched,
it will not cause any actual problem. But It will be more reasonable
to do this change.
Signed-off-by: NYufen Yu <yuyufen@huawei.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
上级 7ea6bf2e
...@@ -740,7 +740,6 @@ static void blk_exit_queue(struct request_queue *q) ...@@ -740,7 +740,6 @@ static void blk_exit_queue(struct request_queue *q)
if (q->elevator) { if (q->elevator) {
ioc_clear_queue(q); ioc_clear_queue(q);
__elevator_exit(q, q->elevator); __elevator_exit(q, q->elevator);
q->elevator = NULL;
} }
/* /*
......
...@@ -191,8 +191,7 @@ static void elevator_release(struct kobject *kobj) ...@@ -191,8 +191,7 @@ static void elevator_release(struct kobject *kobj)
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); mutex_lock(&e->sysfs_lock);
if (e->type->ops.exit_sched) blk_mq_exit_sched(q, e);
blk_mq_exit_sched(q, e);
mutex_unlock(&e->sysfs_lock); mutex_unlock(&e->sysfs_lock);
kobject_put(&e->kobj); kobject_put(&e->kobj);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册