]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
block: always assign default lock to queues
authorJens Axboe <jens.axboe@oracle.com>
Tue, 28 Jul 2009 07:07:29 +0000 (09:07 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 28 Jul 2009 07:07:29 +0000 (09:07 +0200)
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>
block/blk-core.c
block/blk-settings.c

index 4b45435c6eaf2b3b714f2ce50606a0b053ee63f3..a0c340d239b0d42695d2bcbc0145c977f9c5dc81 100644 (file)
@@ -575,13 +575,6 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t *lock, int node_id)
                return NULL;
        }
 
-       /*
-        * if caller didn't supply a lock, they get per-queue locking with
-        * our embedded lock
-        */
-       if (!lock)
-               lock = &q->__queue_lock;
-
        q->request_fn           = rfn;
        q->prep_rq_fn           = NULL;
        q->unplug_fn            = generic_unplug_device;
index bd582a7f5310efcbe53e39eb3f1da8abf83d2eb2..8a3ea3bba10d6c06a7276a3146864b3c674271b3 100644 (file)
@@ -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
         */