rbd: mark block queue as non-rotational
authorIlya Dryomov <idryomov@gmail.com>
Tue, 24 Mar 2015 13:15:17 +0000 (16:15 +0300)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 20 Apr 2015 15:55:38 +0000 (18:55 +0300)
Set QUEUE_FLAG_NONROT.  Following commit b277da0a8a59 ("block: disable
entropy contributions for nonrot devices") we should also clear
QUEUE_FLAG_ADD_RANDOM, but it's off by default for blk-mq drivers, so
just note it in the comment.

Also remove physical block size assignment - no sense in repeating
defaults that are not going to change.

Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
drivers/block/rbd.c

index 83f5733f1a7a274ea644885afb54a69fe4331d51..2002d28c5d5b0249b4e6d7cd0813d888738e0580 100644 (file)
@@ -3762,8 +3762,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
                goto out_tag_set;
        }
 
-       /* We use the default size, but let's be explicit about it. */
-       blk_queue_physical_block_size(q, SECTOR_SIZE);
+       queue_flag_set_unlocked(QUEUE_FLAG_NONROT, q);
+       /* QUEUE_FLAG_ADD_RANDOM is off by default for blk-mq */
 
        /* set io sizes to object size */
        segment_size = rbd_obj_bytes(&rbd_dev->header);