lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 23 Oct 2019 20:31:58 +0000
From:   Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>
To:     Logan Gunthorpe <logang@...tatee.com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>
CC:     Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
        Max Gurtovoy <maxg@...lanox.com>,
        Stephen Bates <sbates@...thlin.com>
Subject: Re: [PATCH 5/7] nvmet: Introduce nvmet_dsm_len() helper

Looks good.

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

On 10/23/2019 09:36 AM, Logan Gunthorpe wrote:
> Similar to the nvmet_rw_len helper.
>
> Signed-off-by: Christoph Hellwig <hch@....de>
> [logang@...tatee.com: separated out of a larger draft patch from hch]
> Signed-off-by: Logan Gunthorpe <logang@...tatee.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 */
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ