diff options
author | Jens Axboe <jens.axboe@oracle.com> | 2008-05-07 03:27:43 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2008-05-07 03:27:43 -0400 |
commit | aa94b5371f6f898558d9fa5690cc6e4bf917a572 (patch) | |
tree | 06afaf32fce70c41eddf334666125c2ed75b17b1 /block | |
parent | bf0f97025c7306870b86ccd63669aa278e7ec1c2 (diff) |
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
counted.
So switch the general queue flag setting to the unlocked variant, but
retain the locked variant for resizing.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-tag.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/block/blk-tag.c b/block/blk-tag.c index de64e0429977..32667beb03ee 100644 --- a/block/blk-tag.c +++ b/block/blk-tag.c | |||
@@ -70,7 +70,7 @@ void __blk_queue_free_tags(struct request_queue *q) | |||
70 | __blk_free_tags(bqt); | 70 | __blk_free_tags(bqt); |
71 | 71 | ||
72 | q->queue_tags = NULL; | 72 | q->queue_tags = NULL; |
73 | queue_flag_clear(QUEUE_FLAG_QUEUED, q); | 73 | queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q); |
74 | } | 74 | } |
75 | 75 | ||
76 | /** | 76 | /** |
@@ -98,7 +98,7 @@ EXPORT_SYMBOL(blk_free_tags); | |||
98 | **/ | 98 | **/ |
99 | void blk_queue_free_tags(struct request_queue *q) | 99 | void blk_queue_free_tags(struct request_queue *q) |
100 | { | 100 | { |
101 | queue_flag_clear(QUEUE_FLAG_QUEUED, q); | 101 | queue_flag_clear_unlocked(QUEUE_FLAG_QUEUED, q); |
102 | } | 102 | } |
103 | EXPORT_SYMBOL(blk_queue_free_tags); | 103 | EXPORT_SYMBOL(blk_queue_free_tags); |
104 | 104 | ||
@@ -171,6 +171,9 @@ EXPORT_SYMBOL(blk_init_tags); | |||
171 | * @q: the request queue for the device | 171 | * @q: the request queue for the device |
172 | * @depth: the maximum queue depth supported | 172 | * @depth: the maximum queue depth supported |
173 | * @tags: the tag to use | 173 | * @tags: the tag to use |
174 | * | ||
175 | * Queue lock must be held here if the function is called to resize an | ||
176 | * existing map. | ||
174 | **/ | 177 | **/ |
175 | int blk_queue_init_tags(struct request_queue *q, int depth, | 178 | int blk_queue_init_tags(struct request_queue *q, int depth, |
176 | struct blk_queue_tag *tags) | 179 | struct blk_queue_tag *tags) |
@@ -197,7 +200,7 @@ int blk_queue_init_tags(struct request_queue *q, int depth, | |||
197 | * assign it, all done | 200 | * assign it, all done |
198 | */ | 201 | */ |
199 | q->queue_tags = tags; | 202 | q->queue_tags = tags; |
200 | queue_flag_set(QUEUE_FLAG_QUEUED, q); | 203 | queue_flag_set_unlocked(QUEUE_FLAG_QUEUED, q); |
201 | INIT_LIST_HEAD(&q->tag_busy_list); | 204 | INIT_LIST_HEAD(&q->tag_busy_list); |
202 | return 0; | 205 | return 0; |
203 | fail: | 206 | fail: |