aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/aoe/aoeblk.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/block/aoe/aoeblk.c')
-rw-r--r--drivers/block/aoe/aoeblk.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 2307a271bdc9..95d344971eda 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -264,9 +264,13 @@ aoeblk_gdalloc(void *vp)
264 goto err_disk; 264 goto err_disk;
265 } 265 }
266 266
267 blk_queue_make_request(&d->blkq, aoeblk_make_request); 267 d->blkq = blk_alloc_queue(GFP_KERNEL);
268 if (bdi_init(&d->blkq.backing_dev_info)) 268 if (!d->blkq)
269 goto err_mempool; 269 goto err_mempool;
270 blk_queue_make_request(d->blkq, aoeblk_make_request);
271 d->blkq->backing_dev_info.name = "aoe";
272 if (bdi_init(&d->blkq->backing_dev_info))
273 goto err_blkq;
270 spin_lock_irqsave(&d->lock, flags); 274 spin_lock_irqsave(&d->lock, flags);
271 gd->major = AOE_MAJOR; 275 gd->major = AOE_MAJOR;
272 gd->first_minor = d->sysminor * AOE_PARTITIONS; 276 gd->first_minor = d->sysminor * AOE_PARTITIONS;
@@ -276,7 +280,7 @@ aoeblk_gdalloc(void *vp)
276 snprintf(gd->disk_name, sizeof gd->disk_name, "etherd/e%ld.%d", 280 snprintf(gd->disk_name, sizeof gd->disk_name, "etherd/e%ld.%d",
277 d->aoemajor, d->aoeminor); 281 d->aoemajor, d->aoeminor);
278 282
279 gd->queue = &d->blkq; 283 gd->queue = d->blkq;
280 d->gd = gd; 284 d->gd = gd;
281 d->flags &= ~DEVFL_GDALLOC; 285 d->flags &= ~DEVFL_GDALLOC;
282 d->flags |= DEVFL_UP; 286 d->flags |= DEVFL_UP;
@@ -287,6 +291,9 @@ aoeblk_gdalloc(void *vp)
287 aoedisk_add_sysfs(d); 291 aoedisk_add_sysfs(d);
288 return; 292 return;
289 293
294err_blkq:
295 blk_cleanup_queue(d->blkq);
296 d->blkq = NULL;
290err_mempool: 297err_mempool:
291 mempool_destroy(d->bufpool); 298 mempool_destroy(d->bufpool);
292err_disk: 299err_disk: