All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Kanchan Joshi <joshi.k@samsung.com>
Cc: hch@lst.de, kbusch@kernel.org, axboe@kernel.dk,
	linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
	joshiiitr@gmail.com
Subject: Re: [PATCH 1/2] block: introduce and export blk_rq_map_user_vec
Date: Thu, 27 Jan 2022 10:27:46 +0100	[thread overview]
Message-ID: <20220127092746.GA14431@lst.de> (raw)
In-Reply-To: <20220127082536.7243-2-joshi.k@samsung.com>

On Thu, Jan 27, 2022 at 01:55:35PM +0530, Kanchan Joshi wrote:
> Similiar to blk_rq_map_user except that it operates on iovec.
> This is a prep patch.
> 
> Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
> Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
> ---
>  block/blk-map.c        | 19 +++++++++++++++++++
>  include/linux/blk-mq.h |  2 ++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/block/blk-map.c b/block/blk-map.c
> index 4526adde0156..7fe45df3e580 100644
> --- a/block/blk-map.c
> +++ b/block/blk-map.c
> @@ -577,6 +577,25 @@ int blk_rq_map_user(struct request_queue *q, struct request *rq,
>  }
>  EXPORT_SYMBOL(blk_rq_map_user);
>  
> +int blk_rq_map_user_vec(struct request_queue *q, struct request *rq,
> +		    struct rq_map_data *map_data, void __user *uvec,
> +		    unsigned long nr_vecs, gfp_t gfp_mask)
> +{
> +	struct iovec fast_iov[UIO_FASTIOV];
> +	struct iovec *iov = fast_iov;
> +	struct iov_iter iter;
> +	int ret;
> +
> +	ret = import_iovec(rq_data_dir(rq), uvec, nr_vecs, UIO_FASTIOV, &iov, &iter);
> +	if (unlikely(ret < 0))
> +		return ret;
> +	ret = blk_rq_map_user_iov(q, rq, NULL, &iter, gfp_mask);
> +	kfree(iov);
> +
> +	return ret;

I see very little point in adding this function vs just open coding it.

Also please don't add overly long lines.

  reply	other threads:[~2022-01-27  9:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20220127083033epcas5p3ce9565e4b5e21e897571e48e73e4f9af@epcas5p3.samsung.com>
2022-01-27  8:25 ` [PATCH 0/2] nvme-passthru with vectored-io Kanchan Joshi
     [not found]   ` <CGME20220127083034epcas5p4aaafaf1f40c21a383e985d6f6568cbef@epcas5p4.samsung.com>
2022-01-27  8:25     ` [PATCH 1/2] block: introduce and export blk_rq_map_user_vec Kanchan Joshi
2022-01-27  9:27       ` Christoph Hellwig [this message]
2022-01-27 14:38         ` Kanchan Joshi
2022-01-28  9:04       ` Chaitanya Kulkarni
     [not found]   ` <CGME20220127083035epcas5p3e3760849513fb7939757f4e6678405a0@epcas5p3.samsung.com>
2022-01-27  8:25     ` [PATCH 2/2] nvme: add vectored-io support for user passthru Kanchan Joshi
2022-01-27  9:29       ` Christoph Hellwig
2022-01-27 14:43         ` Kanchan Joshi
2022-01-28  9:08           ` Chaitanya Kulkarni

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=20220127092746.GA14431@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=joshi.k@samsung.com \
    --cc=joshiiitr@gmail.com \
    --cc=kbusch@kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-nvme@lists.infradead.org \
    /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.