Commit aa94b537 authored by Jens Axboe's avatar Jens Axboe

block: adjust tagging function queue bit locking

For most initialization purposes, calling blk_queue_init_tags() without
the queue lock held is OK. Only if called for resizing an existing map
must the lock be held. Ditto for tag cleanup, the maps are reference

So switch the general queue flag setting to the unlocked variant, but
retain the locked variant for resizing.
Signed-off-by: default avatarJens Axboe <>
parent bf0f9702
......@@ -70,7 +70,7 @@ void __blk_queue_free_tags(struct request_queue *q)
q->queue_tags = NULL;
queue_flag_clear(QUEUE_FLAG_QUEUED, q);
queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
......@@ -98,7 +98,7 @@ EXPORT_SYMBOL(blk_free_tags);
void blk_queue_free_tags(struct request_queue *q)
queue_flag_clear(QUEUE_FLAG_QUEUED, q);
queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q);
......@@ -171,6 +171,9 @@ EXPORT_SYMBOL(blk_init_tags);
* @q: the request queue for the device
* @depth: the maximum queue depth supported
* @tags: the tag to use
* Queue lock must be held here if the function is called to resize an
* existing map.
int blk_queue_init_tags(struct request_queue *q, int depth,
struct blk_queue_tag *tags)
......@@ -197,7 +200,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth,
* assign it, all done
q->queue_tags = tags;
queue_flag_set(QUEUE_FLAG_QUEUED, q);
queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, q);
return 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment