Commit a4e7d46407d73f35d217013b363b79a8f8eafcaa
1 parent
a85a00a699
Exists in
master
and in
39 other branches
block: always assign default lock to queues
Move the assignment of a default lock below blk_init_queue() to blk_queue_make_request(), so we also get to set the default lock for ->make_request_fn() based drivers. This is important since the queue flag locking requires a lock to be in place. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Showing 2 changed files with 7 additions and 7 deletions Side-by-side Diff
block/blk-core.c
... | ... | @@ -575,13 +575,6 @@ |
575 | 575 | return NULL; |
576 | 576 | } |
577 | 577 | |
578 | - /* | |
579 | - * if caller didn't supply a lock, they get per-queue locking with | |
580 | - * our embedded lock | |
581 | - */ | |
582 | - if (!lock) | |
583 | - lock = &q->__queue_lock; | |
584 | - | |
585 | 578 | q->request_fn = rfn; |
586 | 579 | q->prep_rq_fn = NULL; |
587 | 580 | q->unplug_fn = generic_unplug_device; |
block/blk-settings.c
... | ... | @@ -165,6 +165,13 @@ |
165 | 165 | blk_set_default_limits(&q->limits); |
166 | 166 | |
167 | 167 | /* |
168 | + * If the caller didn't supply a lock, fall back to our embedded | |
169 | + * per-queue locks | |
170 | + */ | |
171 | + if (!q->queue_lock) | |
172 | + q->queue_lock = &q->__queue_lock; | |
173 | + | |
174 | + /* | |
168 | 175 | * by default assume old behaviour and bounce for any highmem page |
169 | 176 | */ |
170 | 177 | blk_queue_bounce_limit(q, BLK_BOUNCE_HIGH); |