]> www.infradead.org Git - linux.git/commitdiff
block/rnbd: client device does not care queue/rotational
authorGioh Kim <gi-oh.kim@ionos.com>
Fri, 14 Jan 2022 15:58:55 +0000 (16:58 +0100)
committerJens Axboe <axboe@kernel.dk>
Sun, 27 Feb 2022 21:49:48 +0000 (14:49 -0700)
On client side, the device is a network device. There is no reason
to set rotational even-if the target device on server is rotational.

Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Link: https://lore.kernel.org/r/20220114155855.984144-3-haris.iqbal@ionos.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/block/rnbd/rnbd-clt.c
drivers/block/rnbd/rnbd-clt.h
drivers/block/rnbd/rnbd-proto.h
drivers/block/rnbd/rnbd-srv.c

index f0370a345c3e7edacd06c075dab2cc4464872319..9a880d559ab86669a5a49ac8ad194bec666e01e9 100644 (file)
@@ -87,7 +87,6 @@ static int rnbd_clt_set_dev_attr(struct rnbd_clt_dev *dev,
        dev->discard_granularity    = le32_to_cpu(rsp->discard_granularity);
        dev->discard_alignment      = le32_to_cpu(rsp->discard_alignment);
        dev->secure_discard         = le16_to_cpu(rsp->secure_discard);
-       dev->rotational             = rsp->rotational;
        dev->wc                     = !!(rsp->cache_policy & RNBD_WRITEBACK);
        dev->fua                    = !!(rsp->cache_policy & RNBD_FUA);
 
@@ -1410,8 +1409,10 @@ static int rnbd_clt_setup_gen_disk(struct rnbd_clt_dev *dev, int idx)
                dev->read_only = false;
        }
 
-       if (!dev->rotational)
-               blk_queue_flag_set(QUEUE_FLAG_NONROT, dev->queue);
+       /*
+        * Network device does not need rotational
+        */
+       blk_queue_flag_set(QUEUE_FLAG_NONROT, dev->queue);
        err = add_disk(dev->gd);
        if (err)
                blk_cleanup_disk(dev->gd);
@@ -1610,13 +1611,13 @@ struct rnbd_clt_dev *rnbd_clt_map_device(const char *sessname,
        }
 
        rnbd_clt_info(dev,
-                      "map_device: Device mapped as %s (nsectors: %zu, logical_block_size: %d, physical_block_size: %d, max_write_same_sectors: %d, max_discard_sectors: %d, discard_granularity: %d, discard_alignment: %d, secure_discard: %d, max_segments: %d, max_hw_sectors: %d, rotational: %d, wc: %d, fua: %d)\n",
+                      "map_device: Device mapped as %s (nsectors: %zu, logical_block_size: %d, physical_block_size: %d, max_write_same_sectors: %d, max_discard_sectors: %d, discard_granularity: %d, discard_alignment: %d, secure_discard: %d, max_segments: %d, max_hw_sectors: %d, wc: %d, fua: %d)\n",
                       dev->gd->disk_name, dev->nsectors,
                       dev->logical_block_size, dev->physical_block_size,
                       dev->max_write_same_sectors, dev->max_discard_sectors,
                       dev->discard_granularity, dev->discard_alignment,
                       dev->secure_discard, dev->max_segments,
-                      dev->max_hw_sectors, dev->rotational, dev->wc, dev->fua);
+                      dev->max_hw_sectors, dev->wc, dev->fua);
 
        mutex_unlock(&dev->lock);
        rnbd_clt_put_sess(sess);
index 0c2cae7f39b9fe9a7aef5dac798da4850425ff77..62bf7c3fa63c6fd33eae74a5991fa9e4a74d29f5 100644 (file)
@@ -118,7 +118,6 @@ struct rnbd_clt_dev {
        enum rnbd_access_mode   access_mode;
        u32                     nr_poll_queues;
        bool                    read_only;
-       bool                    rotational;
        bool                    wc;
        bool                    fua;
        u32                     max_hw_sectors;
index de5d5a8df81d73273d4a7b5522188a7df853662e..c4a68b3a1cbe8501d9887f103f1c0b086653ec05 100644 (file)
@@ -128,7 +128,7 @@ enum rnbd_cache_policy {
  * @logical_block_size: logical block size device supports in bytes
  * @max_segments:      max segments hardware support in one transfer
  * @secure_discard:    supports secure discard
- * @rotation:          is a rotational disc?
+ * @obsolete_rotational: obsolete, not in used.
  * @cache_policy:      support write-back caching or FUA?
  */
 struct rnbd_msg_open_rsp {
@@ -144,7 +144,7 @@ struct rnbd_msg_open_rsp {
        __le16                  logical_block_size;
        __le16                  max_segments;
        __le16                  secure_discard;
-       u8                      rotational;
+       u8                      obsolete_rotational;
        u8                      cache_policy;
        u8                      reserved[10];
 };
index 132e950685d5985fb862807abeb61744f2d01bcb..6499efae5c43e3ac536eb9aef3ba9e2fac1d3d6c 100644 (file)
@@ -558,7 +558,6 @@ static void rnbd_srv_fill_msg_open_rsp(struct rnbd_msg_open_rsp *rsp,
                cpu_to_le32(rnbd_dev_get_discard_alignment(rnbd_dev));
        rsp->secure_discard =
                cpu_to_le16(rnbd_dev_get_secure_discard(rnbd_dev));
-       rsp->rotational = !blk_queue_nonrot(q);
        rsp->cache_policy = 0;
        if (test_bit(QUEUE_FLAG_WC, &q->queue_flags))
                rsp->cache_policy |= RNBD_WRITEBACK;