···348348EXPORT_SYMBOL(blk_put_queue);349349350350/*351351- * Note: If a driver supplied the queue lock, it should not zap that lock352352- * unexpectedly as some queue cleanup components like elevator_exit() and353353- * blk_throtl_exit() need queue lock.351351+ * Note: If a driver supplied the queue lock, it is disconnected352352+ * by this function. The actual state of the lock doesn't matter353353+ * here as the request_queue isn't accessible after this point354354+ * (QUEUE_FLAG_DEAD is set) and no other requests will be queued.354355 */355356void blk_cleanup_queue(struct request_queue *q)356357{···368367 queue_flag_set_unlocked(QUEUE_FLAG_DEAD, q);369368 mutex_unlock(&q->sysfs_lock);370369371371- if (q->elevator)372372- elevator_exit(q->elevator);373373-374374- blk_throtl_exit(q);370370+ if (q->queue_lock != &q->__queue_lock)371371+ q->queue_lock = &q->__queue_lock;375372376373 blk_put_queue(q);377374}
+5
block/blk-sysfs.c
···479479480480 blk_sync_queue(q);481481482482+ if (q->elevator)483483+ elevator_exit(q->elevator);484484+485485+ blk_throtl_exit(q);486486+482487 if (rl->rq_pool)483488 mempool_destroy(rl->rq_pool);484489