Merge tag 'staging-5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[linux-2.6-microblaze.git] / block / blk-sysfs.c
index cd75b0f..e20eadf 100644 (file)
@@ -16,6 +16,7 @@
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-debugfs.h"
+#include "blk-mq-sched.h"
 #include "blk-wbt.h"
 #include "blk-throttle.h"
 
@@ -734,7 +735,8 @@ static void blk_free_queue_rcu(struct rcu_head *rcu_head)
 {
        struct request_queue *q = container_of(rcu_head, struct request_queue,
                                               rcu_head);
-       kmem_cache_free(blk_requestq_cachep, q);
+
+       kmem_cache_free(blk_get_queue_kmem_cache(blk_queue_has_srcu(q)), q);
 }
 
 /* Unconfigure the I/O scheduler and dissociate from the cgroup controller. */
@@ -747,7 +749,7 @@ static void blk_exit_queue(struct request_queue *q)
         */
        if (q->elevator) {
                ioc_clear_queue(q);
-               __elevator_exit(q, q->elevator);
+               elevator_exit(q);
        }
 
        /*
@@ -785,14 +787,15 @@ static void blk_release_queue(struct kobject *kobj)
 
        might_sleep();
 
-       if (test_bit(QUEUE_FLAG_POLL_STATS, &q->queue_flags))
+       if (q->poll_stat)
                blk_stat_remove_callback(q, q->poll_cb);
        blk_stat_free_callback(q->poll_cb);
 
-       blk_free_queue_stats(q->stats);
-
        blk_exit_queue(q);
 
+       blk_free_queue_stats(q->stats);
+       kfree(q->poll_stat);
+
        blk_queue_free_zone_bitmaps(q);
 
        if (queue_is_mq(q))