Skip to contentSkip to conversation

Misc RNBD update

PATCH Applied Md Haris Iqbal 2 participants 5 messages Jan 14, 2022 – Jan 26, 2022

Subsystems (2)
lore
Share & tools
lore

Md Haris Iqbal

author maintainer
#0 lore raw

cover Misc RNBD update

Hi Jens,

Please consider to include following change for next merge window.
- fixes warning generated from checkpatch
- removes rotational param from RNBD device

Gioh Kim (2):
block/rnbd-clt: fix CHECK:BRACES warning block/rnbd: client device does not care queue/rotational

 drivers/block/rnbd/rnbd-clt.c   | 15 ++++++++-------
 drivers/block/rnbd/rnbd-clt.h   |  1 -
 drivers/block/rnbd/rnbd-proto.h |  4 ++--
 drivers/block/rnbd/rnbd-srv.c   |  1 -
 4 files changed, 10 insertions(+), 11 deletions(-)
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 1/2 block/rnbd-clt: fix CHECK:BRACES warning

From: Gioh Kim <[email protected]>

This patch fix the "CHECK:BRACES: braces {} should be used on all arms of this statement" warning from checkpatch

---
 drivers/block/rnbd/rnbd-clt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/rnbd/rnbd-clt.c +2 -2
index 67a8edbaa1fd..8c24d3dfe35f 100644
@@ -1262,9 +1262,9 @@ find_and_get_or_create_sess(const char *sessname,
 	struct rtrs_clt_ops rtrs_ops;
 
 	sess = find_or_create_sess(sessname, &first);
-	if (sess == ERR_PTR(-ENOMEM))
+	if (sess == ERR_PTR(-ENOMEM)) {
 		return ERR_PTR(-ENOMEM);
-	else if ((nr_poll_queues && !first) ||  (!nr_poll_queues && sess->nr_poll_queues)) {
+	} else if ((nr_poll_queues && !first) ||  (!nr_poll_queues && sess->nr_poll_queues)) {
 		/*
 		 * A device MUST have its own session to use the polling-mode.
 		 * It must fail to map new device with the same session.
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 2/2 block/rnbd: client device does not care queue/rotational

In reply to Md Haris Iqbal

From: Gioh Kim <[email protected]>

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.

---
 drivers/block/rnbd/rnbd-clt.c   | 11 ++++++-----
 drivers/block/rnbd/rnbd-clt.h   |  1 -
 drivers/block/rnbd/rnbd-proto.h |  4 ++--
 drivers/block/rnbd/rnbd-srv.c   |  1 -
 4 files changed, 8 insertions(+), 9 deletions(-)
drivers/block/rnbd/rnbd-clt.c +6 -5
index 8c24d3dfe35f..6ace401baf8a 100644
@@ -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);
drivers/block/rnbd/rnbd-clt.h +0 -1
index 9ef8c4f306f2..715e616b8a91 100644
@@ -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;
drivers/block/rnbd/rnbd-proto.h +2 -2
index de5d5a8df81d..c4a68b3a1cbe 100644
@@ -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];
 };
drivers/block/rnbd/rnbd-srv.c +0 -1
index aafecfe97055..4f5d919f3760 100644
@@ -568,7 +568,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;
Signature · 1 line
2.25.1
author maintainer
#3 lore raw
In reply to Md Haris Iqbal
Quoted 6 lines · Md Haris Iqbal

Hi Jens,

Please consider to include following change for next merge window.
- fixes warning generated from checkpatch
- removes rotational param from RNBD device

Ping.

Quoted 14 lines

Gioh Kim (2):
block/rnbd-clt: fix CHECK:BRACES warning block/rnbd: client device does not care queue/rotational

 drivers/block/rnbd/rnbd-clt.c   | 15 ++++++++-------
 drivers/block/rnbd/rnbd-clt.h   |  1 -
 drivers/block/rnbd/rnbd-proto.h |  4 ++--
 drivers/block/rnbd/rnbd-srv.c   |  1 -
 4 files changed, 10 insertions(+), 11 deletions(-)

--
2.25.1

maintainer Applied
#4 lore raw
In reply to Md Haris Iqbal
Quoted 9 lines · Md Haris Iqbal

Please consider to include following change for next merge window.
- fixes warning generated from checkpatch
- removes rotational param from RNBD device

Gioh Kim (2):
block/rnbd-clt: fix CHECK:BRACES warning block/rnbd: client device does not care queue/rotational

[...]

Applied, thanks!

[1/2] block/rnbd-clt: fix CHECK:BRACES warning

      commit: 7cb0c32efbae2a7000f74243d8b4cab35d669cbd
[2/2] block/rnbd: client device does not care queue/rotational
      commit: de53a6a82aad3010d7e9c3151cba5e4e46b6ec32

Best regards,

Signature · 1 line
Jens Axboe