summaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2013-11-14 08:29:01 -0700
committerJens Axboe <axboe@kernel.dk>2013-11-14 08:29:01 -0700
commit1355b37f111b35cd6f53078ce63997aec473629f (patch)
tree590ecf1b148fc631336213a956d8456ce85bdc42 /drivers/block/loop.c
parentf618ef7c47934d1686a764d0c9f70f23e566683f (diff)
parentc86949486d41d9e7d7681fc72923555114fd702f (diff)
downloadtalos-op-linux-1355b37f111b35cd6f53078ce63997aec473629f.tar.gz
talos-op-linux-1355b37f111b35cd6f53078ce63997aec473629f.zip
Merge branch 'for-3.13/post-mq-drivers' into for-linus
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index dbdb88a4976c..c8dac7305244 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -894,13 +894,6 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode,
bio_list_init(&lo->lo_bio_list);
- /*
- * set queue make_request_fn, and add limits based on lower level
- * device
- */
- blk_queue_make_request(lo->lo_queue, loop_make_request);
- lo->lo_queue->queuedata = lo;
-
if (!(lo_flags & LO_FLAGS_READ_ONLY) && file->f_op->fsync)
blk_queue_flush(lo->lo_queue, REQ_FLUSH);
@@ -1618,6 +1611,8 @@ static int loop_add(struct loop_device **l, int i)
if (!lo)
goto out;
+ lo->lo_state = Lo_unbound;
+
/* allocate id, if @id >= 0, we're requesting that specific id */
if (i >= 0) {
err = idr_alloc(&loop_index_idr, lo, i, i + 1, GFP_KERNEL);
@@ -1635,6 +1630,12 @@ static int loop_add(struct loop_device **l, int i)
if (!lo->lo_queue)
goto out_free_idr;
+ /*
+ * set queue make_request_fn
+ */
+ blk_queue_make_request(lo->lo_queue, loop_make_request);
+ lo->lo_queue->queuedata = lo;
+
disk = lo->lo_disk = alloc_disk(1 << part_shift);
if (!disk)
goto out_free_queue;
OpenPOWER on IntegriCloud