Skip to content

Commit 31dcfab

Browse files
author
Jens Axboe
committed
nbd: tell the block layer that it is not a rotational device
Then we can get rid of that manual elevator type fiddling. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
1 parent b374d18 commit 31dcfab

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎drivers/block/nbd.c‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,6 @@ static int __init nbd_init(void)
722722

723723
for (i = 0; i < nbds_max; i++) {
724724
struct gendisk *disk = alloc_disk(1 << part_shift);
725-
struct elevator_queue *old_e;
726725
if (!disk)
727726
goto out;
728727
nbd_dev[i].disk = disk;
@@ -736,11 +735,10 @@ static int __init nbd_init(void)
736735
put_disk(disk);
737736
goto out;
738737
}
739-
old_e = disk->queue->elevator;
740-
if (elevator_init(disk->queue, "deadline") == 0 ||
741-
elevator_init(disk->queue, "noop") == 0) {
742-
elevator_exit(old_e);
743-
}
738+
/*
739+
* Tell the block layer that we are not a rotational device
740+
*/
741+
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, disk->queue);
744742
}
745743

746744
if (register_blkdev(NBD_MAJOR, "nbd")) {

0 commit comments

Comments
 (0)