diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/nbd.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 018753c59b8e..b53fdb0a282c 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -655,6 +655,7 @@ static int __init nbd_init(void) | |||
655 | 655 | ||
656 | for (i = 0; i < nbds_max; i++) { | 656 | for (i = 0; i < nbds_max; i++) { |
657 | struct gendisk *disk = alloc_disk(1); | 657 | struct gendisk *disk = alloc_disk(1); |
658 | elevator_t *old_e; | ||
658 | if (!disk) | 659 | if (!disk) |
659 | goto out; | 660 | goto out; |
660 | nbd_dev[i].disk = disk; | 661 | nbd_dev[i].disk = disk; |
@@ -668,6 +669,11 @@ static int __init nbd_init(void) | |||
668 | put_disk(disk); | 669 | put_disk(disk); |
669 | goto out; | 670 | goto out; |
670 | } | 671 | } |
672 | old_e = disk->queue->elevator; | ||
673 | if (elevator_init(disk->queue, "deadline") == 0 || | ||
674 | elevator_init(disk->queue, "noop") == 0) { | ||
675 | elevator_exit(old_e); | ||
676 | } | ||
671 | } | 677 | } |
672 | 678 | ||
673 | if (register_blkdev(NBD_MAJOR, "nbd")) { | 679 | if (register_blkdev(NBD_MAJOR, "nbd")) { |