[PATCH for-next v10 4/7] nvme: refactor nvme_alloc_request
Anuj Gupta
anuj20.g at samsung.com
Thu Sep 29 04:30:25 PDT 2022
On Wed, Sep 28, 2022 at 07:19:32PM +0200, Christoph Hellwig wrote:
> > + if (!vec)
> > + ret = blk_rq_map_user(q, req, NULL, ubuffer, bufflen,
> > + GFP_KERNEL);
> > + else {
> > + struct iovec fast_iov[UIO_FASTIOV];
> > + struct iovec *iov = fast_iov;
> > + struct iov_iter iter;
> > +
> > + ret = import_iovec(rq_data_dir(req), ubuffer, bufflen,
> > + UIO_FASTIOV, &iov, &iter);
> > + if (ret < 0)
> > goto out;
> > +
> > + ret = blk_rq_map_user_iov(q, req, NULL, &iter, GFP_KERNEL);
> > + kfree(iov);
> > + }
>
> As mentioned before this is something that should got into blk-map.c
> as a separate helper, and scsi_ioctl.c and sg.c should be switched to
> use it as well.
>
sure, this will be done in the next iteration
> Otherwise this looks good.
--
Anuj Gupta
>
More information about the Linux-nvme
mailing list