All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
	Max Gurtovoy <maxg@mellanox.com>,
	Stephen Bates <sbates@raithlin.com>
Subject: Re: [PATCH 5/7] nvmet: Introduce nvmet_dsm_len() helper
Date: Wed, 23 Oct 2019 20:31:58 +0000	[thread overview]
Message-ID: <BYAPR04MB574984DB7059767E40564B4C866B0@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20191023163545.4193-6-logang@deltatee.com

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 10/23/2019 09:36 AM, Logan Gunthorpe wrote:
> Similar to the nvmet_rw_len helper.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [logang@deltatee.com: separated out of a larger draft patch from hch]
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> ---
>   drivers/nvme/target/io-cmd-file.c | 3 +--
>   drivers/nvme/target/nvmet.h       | 6 ++++++
>   2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
> index 05453f5d1448..7481556da6e6 100644
> --- a/drivers/nvme/target/io-cmd-file.c
> +++ b/drivers/nvme/target/io-cmd-file.c
> @@ -379,8 +379,7 @@ u16 nvmet_file_parse_io_cmd(struct nvmet_req *req)
>   		return 0;
>   	case nvme_cmd_dsm:
>   		req->execute = nvmet_file_execute_dsm;
> -		req->data_len = (le32_to_cpu(cmd->dsm.nr) + 1) *
> -			sizeof(struct nvme_dsm_range);
> +		req->data_len = nvmet_dsm_len(req);
>   		return 0;
>   	case nvme_cmd_write_zeroes:
>   		req->execute = nvmet_file_execute_write_zeroes;
> diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
> index c51f8dd01dc4..6ccf2d098d9f 100644
> --- a/drivers/nvme/target/nvmet.h
> +++ b/drivers/nvme/target/nvmet.h
> @@ -495,6 +495,12 @@ static inline u32 nvmet_rw_len(struct nvmet_req *req)
>   			req->ns->blksize_shift;
>   }
>
> +static inline u32 nvmet_dsm_len(struct nvmet_req *req)
> +{
> +	return (le32_to_cpu(req->cmd->dsm.nr) + 1) *
> +		sizeof(struct nvme_dsm_range);
> +}
> +
>   u16 errno_to_nvme_status(struct nvmet_req *req, int errno);
>
>   /* Convert a 32-bit number to a 16-bit 0's based number */
>


WARNING: multiple messages have this Message-ID (diff)
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: Logan Gunthorpe <logang@deltatee.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: Max Gurtovoy <maxg@mellanox.com>,
	Stephen Bates <sbates@raithlin.com>,
	Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH 5/7] nvmet: Introduce nvmet_dsm_len() helper
Date: Wed, 23 Oct 2019 20:31:58 +0000	[thread overview]
Message-ID: <BYAPR04MB574984DB7059767E40564B4C866B0@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20191023163545.4193-6-logang@deltatee.com

Looks good.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 10/23/2019 09:36 AM, Logan Gunthorpe wrote:
> Similar to the nvmet_rw_len helper.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> [logang@deltatee.com: separated out of a larger draft patch from hch]
> Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
> ---
>   drivers/nvme/target/io-cmd-file.c | 3 +--
>   drivers/nvme/target/nvmet.h       | 6 ++++++
>   2 files changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
> index 05453f5d1448..7481556da6e6 100644
> --- a/drivers/nvme/target/io-cmd-file.c
> +++ b/drivers/nvme/target/io-cmd-file.c
> @@ -379,8 +379,7 @@ u16 nvmet_file_parse_io_cmd(struct nvmet_req *req)
>   		return 0;
>   	case nvme_cmd_dsm:
>   		req->execute = nvmet_file_execute_dsm;
> -		req->data_len = (le32_to_cpu(cmd->dsm.nr) + 1) *
> -			sizeof(struct nvme_dsm_range);
> +		req->data_len = nvmet_dsm_len(req);
>   		return 0;
>   	case nvme_cmd_write_zeroes:
>   		req->execute = nvmet_file_execute_write_zeroes;
> diff --git a/drivers/nvme/target/nvmet.h b/drivers/nvme/target/nvmet.h
> index c51f8dd01dc4..6ccf2d098d9f 100644
> --- a/drivers/nvme/target/nvmet.h
> +++ b/drivers/nvme/target/nvmet.h
> @@ -495,6 +495,12 @@ static inline u32 nvmet_rw_len(struct nvmet_req *req)
>   			req->ns->blksize_shift;
>   }
>
> +static inline u32 nvmet_dsm_len(struct nvmet_req *req)
> +{
> +	return (le32_to_cpu(req->cmd->dsm.nr) + 1) *
> +		sizeof(struct nvme_dsm_range);
> +}
> +
>   u16 errno_to_nvme_status(struct nvmet_req *req, int errno);
>
>   /* Convert a 32-bit number to a 16-bit 0's based number */
>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-10-23 20:32 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-23 16:35 [PATCH 0/7] Remove data_len field from the nvmet_req struct Logan Gunthorpe
2019-10-23 16:35 ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 1/7] nvmet-tcp: Don't check data_len in nvmet_tcp_map_data() Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-24  1:15   ` Christoph Hellwig
2019-10-24  1:15     ` Christoph Hellwig
2019-10-23 16:35 ` [PATCH 2/7] nvmet-tcp: Don't set the request's data_len Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-24  1:15   ` Christoph Hellwig
2019-10-24  1:15     ` Christoph Hellwig
2019-10-23 16:35 ` [PATCH 3/7] nvmet: Introduce common execute function for get_log_page and identify Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:31   ` Chaitanya Kulkarni
2019-10-23 20:31     ` Chaitanya Kulkarni
2019-10-24  1:17   ` Christoph Hellwig
2019-10-24  1:17     ` Christoph Hellwig
2019-10-24 17:18     ` Logan Gunthorpe
2019-10-24 17:18       ` Logan Gunthorpe
2019-10-24 22:01       ` Keith Busch
2019-10-24 22:01         ` Keith Busch
2019-10-24 22:40         ` Logan Gunthorpe
2019-10-24 22:40           ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 4/7] nvmet: Cleanup discovery execute handlers Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 5/7] nvmet: Introduce nvmet_dsm_len() helper Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:31   ` Chaitanya Kulkarni [this message]
2019-10-23 20:31     ` Chaitanya Kulkarni
2019-10-23 16:35 ` [PATCH 6/7] nvmet: Remove the data_len field from the nvmet_req struct Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 16:35 ` [PATCH 7/7] nvmet: Open code nvmet_req_execute() Logan Gunthorpe
2019-10-23 16:35   ` Logan Gunthorpe
2019-10-23 20:34   ` Chaitanya Kulkarni
2019-10-23 20:34     ` Chaitanya Kulkarni
2019-10-25  0:20 ` [PATCH 0/7] Remove data_len field from the nvmet_req struct Keith Busch
2019-10-25  0:20   ` Keith Busch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR04MB574984DB7059767E40564B4C866B0@BYAPR04MB5749.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    --cc=logang@deltatee.com \
    --cc=maxg@mellanox.com \
    --cc=sagi@grimberg.me \
    --cc=sbates@raithlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.