[PATCHv7 1/6] io_uring/rw: move fixed buffer import to issue path
Keith Busch
kbusch at kernel.org
Thu Feb 27 13:46:26 PST 2025
On Wed, Feb 26, 2025 at 01:20:24PM -0700, Jens Axboe wrote:
> +static int io_rw_do_import(struct io_kiocb *req, int ddir)
> +{
> + if (!io_do_buffer_select(req)) {
> + struct io_async_rw *io = req->async_data;
> + int ret;
> +
> + ret = io_import_rw_buffer(ddir, req, io, 0);
> + if (unlikely(ret))
> + return ret;
> + }
> +
> + return 0;
> +}
> +
> +static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe,
> + int ddir)
> +{
> + int ret;
> +
> + ret = __io_prep_rw(req, sqe, ddir);
> + if (unlikely(ret))
> + return ret;
> +
> + return io_rw_do_import(req, ddir);
> +}
...
> static int io_prep_rwv(struct io_kiocb *req, const struct io_uring_sqe *sqe,
> int ddir)
> {
> - const bool do_import = !(req->flags & REQ_F_BUFFER_SELECT);
> int ret;
>
> - ret = io_prep_rw(req, sqe, ddir, do_import);
> + ret = io_prep_rw(req, sqe, ddir);
> if (unlikely(ret))
> return ret;
> - if (do_import)
> - return 0;
> + if (!(req->flags & REQ_F_BUFFER_SELECT))
> + return io_rw_do_import(req, ddir);
Not sure if I'm missing something subtle here, but wanted to point out
I've changed the above in the version I'm about to send: io_prep_rw()
already calls io_rw_do_import(), so we can just return 0 here.
More information about the Linux-nvme
mailing list