[PATCH V2 3/4] nvmet-auth: use helper for auth send/recv cmd prep
Hannes Reinecke
hare at suse.de
Mon Jun 5 00:46:43 PDT 2023
On 6/5/23 08:44, Chaitanya Kulkarni wrote:
> Add a common helper to factor out secp/spsp values check and transfer
> buffer allocation in nvmet_execute_auth_send() and
> nvmet_execute_auth_receive().
>
> Signed-off-by: Chaitanya Kulkarni <kch at nvidia.com>
> ---
> drivers/nvme/target/fabrics-cmd-auth.c | 19 +++++++++++--------
> 1 file changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/nvme/target/fabrics-cmd-auth.c b/drivers/nvme/target/fabrics-cmd-auth.c
> index 778961e231a3..d331c22ed26e 100644
> --- a/drivers/nvme/target/fabrics-cmd-auth.c
> +++ b/drivers/nvme/target/fabrics-cmd-auth.c
> @@ -41,6 +41,15 @@ static u16 nvmet_auth_alloc_transfer_buffer(struct nvmet_req *req, void **buf,
> return *buf ? NVME_SC_SUCCESS : NVME_SC_INTERNAL;
> }
>
> +static u16 nvmet_auth_common_prep(struct nvmet_req *req, void **buf, u32 *len)
> +{
> + u16 status = nvmet_auth_check_secp_spsp(req);
> +
> + if (status)
> + return status;
> + return nvmet_auth_alloc_transfer_buffer(req, buf, len);
> +}
> +
A wrapper for a wrapper?
Please move nvmet_auch_check_secp_spsp() tion
nvmet_auth_alloc_tranfer_buffer().
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare at suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), Geschäftsführer: Ivo Totev, Andrew
Myers, Andrew McDonald, Martje Boudien Moerman
More information about the Linux-nvme
mailing list