Skip to content

Commit

Permalink
nbd: tell the block layer that it is not a rotational device
Browse files Browse the repository at this point in the history
Then we can get rid of that manual elevator type fiddling.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
  • Loading branch information
Jens Axboe committed Dec 29, 2008
1 parent b374d18 commit 31dcfab
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ static int __init nbd_init(void)

for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1 << part_shift);
struct elevator_queue *old_e;
if (!disk)
goto out;
nbd_dev[i].disk = disk;
Expand All @@ -736,11 +735,10 @@ static int __init nbd_init(void)
put_disk(disk);
goto out;
}
old_e = disk->queue->elevator;
if (elevator_init(disk->queue, "deadline") == 0 ||
elevator_init(disk->queue, "noop") == 0) {
elevator_exit(old_e);
}
/*
* Tell the block layer that we are not a rotational device
*/
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, disk->queue);
}

if (register_blkdev(NBD_MAJOR, "nbd")) {
Expand Down

0 comments on commit 31dcfab

Please sign in to comment.