diff mbox series

[1/1] block: add sysfs entry for virt boundary mask

Message ID 20210405132012.12504-1-mgurtovoy@nvidia.com (mailing list archive)
State New, archived
Headers show
Series [1/1] block: add sysfs entry for virt boundary mask | expand

Commit Message

Max Gurtovoy April 5, 2021, 1:20 p.m. UTC
This entry will expose the bio vector alignment mask for a specific
block device.

Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 block/blk-sysfs.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Chaitanya Kulkarni April 5, 2021, 5:40 p.m. UTC | #1
On 4/5/21 06:20, Max Gurtovoy wrote:
> +	return queue_var_show(q->limits.virt_boundary_mask, (page));

's/(page)/page/' ?
Ming Lei April 6, 2021, 1:46 a.m. UTC | #2
On Tue, Apr 6, 2021 at 4:43 AM Max Gurtovoy <mgurtovoy@nvidia.com> wrote:
>
> This entry will expose the bio vector alignment mask for a specific
> block device.
>
> Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
> ---
>  block/blk-sysfs.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
> index 0f4f0c8a7825..86a545e6d82d 100644
> --- a/block/blk-sysfs.c
> +++ b/block/blk-sysfs.c
> @@ -264,6 +264,11 @@ static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
>         return queue_var_show(max_hw_sectors_kb, (page));
>  }
>
> +static ssize_t queue_virt_boundary_mask_show(struct request_queue *q, char *page)
> +{
> +       return queue_var_show(q->limits.virt_boundary_mask, (page));
> +}
> +
>  #define QUEUE_SYSFS_BIT_FNS(name, flag, neg)                           \
>  static ssize_t                                                         \
>  queue_##name##_show(struct request_queue *q, char *page)               \
> @@ -610,6 +615,7 @@ QUEUE_RO_ENTRY(queue_fua, "fua");
>  QUEUE_RO_ENTRY(queue_dax, "dax");
>  QUEUE_RW_ENTRY(queue_io_timeout, "io_timeout");
>  QUEUE_RW_ENTRY(queue_wb_lat, "wbt_lat_usec");
> +QUEUE_RO_ENTRY(queue_virt_boundary_mask, "virt_boundary_mask");
>
>  #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
>  QUEUE_RW_ENTRY(blk_throtl_sample_time, "throttle_sample_time");
> @@ -670,6 +676,7 @@ static struct attribute *queue_attrs[] = {
>  #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
>         &blk_throtl_sample_time_entry.attr,
>  #endif
> +       &queue_virt_boundary_mask_entry.attr,
>         NULL,
>  };

Reviewed-by: Ming Lei <ming.lei@redhat.com>
Martin K. Petersen April 6, 2021, 1:53 a.m. UTC | #3
Max,

> This entry will expose the bio vector alignment mask for a specific
> block device.

Looks fine except for the (page) that Chaitanya also pointed out.

Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Max Gurtovoy April 6, 2021, 8:16 a.m. UTC | #4
On 4/6/2021 4:53 AM, Martin K. Petersen wrote:
> Max,
>
>> This entry will expose the bio vector alignment mask for a specific
>> block device.
> Looks fine except for the (page) that Chaitanya also pointed out.

thanks for the review. In blk-sysfs.c we see both "(page) or page". I'm 
fine with Both.

Jens, can this be fixed during the merge to the preferred option please ?


>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
>
Jens Axboe April 6, 2021, 3:23 p.m. UTC | #5
On 4/5/21 7:20 AM, Max Gurtovoy wrote:
> This entry will expose the bio vector alignment mask for a specific
> block device.

Applied with page fixup.
diff mbox series

Patch

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 0f4f0c8a7825..86a545e6d82d 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -264,6 +264,11 @@  static ssize_t queue_max_hw_sectors_show(struct request_queue *q, char *page)
 	return queue_var_show(max_hw_sectors_kb, (page));
 }
 
+static ssize_t queue_virt_boundary_mask_show(struct request_queue *q, char *page)
+{
+	return queue_var_show(q->limits.virt_boundary_mask, (page));
+}
+
 #define QUEUE_SYSFS_BIT_FNS(name, flag, neg)				\
 static ssize_t								\
 queue_##name##_show(struct request_queue *q, char *page)		\
@@ -610,6 +615,7 @@  QUEUE_RO_ENTRY(queue_fua, "fua");
 QUEUE_RO_ENTRY(queue_dax, "dax");
 QUEUE_RW_ENTRY(queue_io_timeout, "io_timeout");
 QUEUE_RW_ENTRY(queue_wb_lat, "wbt_lat_usec");
+QUEUE_RO_ENTRY(queue_virt_boundary_mask, "virt_boundary_mask");
 
 #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
 QUEUE_RW_ENTRY(blk_throtl_sample_time, "throttle_sample_time");
@@ -670,6 +676,7 @@  static struct attribute *queue_attrs[] = {
 #ifdef CONFIG_BLK_DEV_THROTTLING_LOW
 	&blk_throtl_sample_time_entry.attr,
 #endif
+	&queue_virt_boundary_mask_entry.attr,
 	NULL,
 };