From a4e7d46407d73f35d217013b363b79a8f8eafcaa Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 28 Jul 2009 09:07:29 +0200 Subject: 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 --- block/blk-settings.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'block/blk-settings.c') diff --git a/block/blk-settings.c b/block/blk-settings.c index bd582a7f5310..8a3ea3bba10d 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -164,6 +164,13 @@ void blk_queue_make_request(struct request_queue *q, make_request_fn *mfn) blk_set_default_limits(&q->limits); + /* + * If the caller didn't supply a lock, fall back to our embedded + * per-queue locks + */ + if (!q->queue_lock) + q->queue_lock = &q->__queue_lock; + /* * by default assume old behaviour and bounce for any highmem page */ -- cgit v1.2.3