block: Directly use ida_alloc()/free()
[linux-2.6-microblaze.git] / block / blk-core.c
index 06ff5bb..c2cec40 100644 (file)
@@ -322,19 +322,6 @@ void blk_cleanup_queue(struct request_queue *q)
                blk_mq_exit_queue(q);
        }
 
-       /*
-        * In theory, request pool of sched_tags belongs to request queue.
-        * However, the current implementation requires tag_set for freeing
-        * requests, so free the pool now.
-        *
-        * Queue has become frozen, there can't be any in-queue requests, so
-        * it is safe to free requests now.
-        */
-       mutex_lock(&q->sysfs_lock);
-       if (q->elevator)
-               blk_mq_sched_free_rqs(q);
-       mutex_unlock(&q->sysfs_lock);
-
        /* @q is and will stay empty, shutdown and put */
        blk_put_queue(q);
 }
@@ -448,7 +435,7 @@ struct request_queue *blk_alloc_queue(int node_id, bool alloc_srcu)
 
        q->last_merge = NULL;
 
-       q->id = ida_simple_get(&blk_queue_ida, 0, 0, GFP_KERNEL);
+       q->id = ida_alloc(&blk_queue_ida, GFP_KERNEL);
        if (q->id < 0)
                goto fail_srcu;
 
@@ -498,7 +485,7 @@ fail_stats:
 fail_split:
        bioset_exit(&q->bio_split);
 fail_id:
-       ida_simple_remove(&blk_queue_ida, q->id);
+       ida_free(&blk_queue_ida, q->id);
 fail_srcu:
        if (alloc_srcu)
                cleanup_srcu_struct(q->srcu);