Linux io-uring development
 help / color / mirror / Atom feed
From: lizetao <lizetao1@huawei.com>
To: David Wei <dw@davidwei.uk>,
	"io-uring@vger.kernel.org" <io-uring@vger.kernel.org>
Cc: Jens Axboe <axboe@kernel.dk>, Pavel Begunkov <asml.silence@gmail.com>
Subject: RE: [PATCH for-next] io_uring: clean up io_prep_rw_setup()
Date: Sat, 7 Dec 2024 05:19:33 +0000	[thread overview]
Message-ID: <62af3d54790b4b3f9a83234d6259ca97@huawei.com> (raw)
In-Reply-To: <20241207004144.783631-1-dw@davidwei.uk>



> -----Original Message-----
> From: David Wei <dw@davidwei.uk>
> Sent: Saturday, December 7, 2024 8:42 AM
> To: io-uring@vger.kernel.org
> Cc: David Wei <dw@davidwei.uk>; Jens Axboe <axboe@kernel.dk>; Pavel
> Begunkov <asml.silence@gmail.com>
> Subject: [PATCH for-next] io_uring: clean up io_prep_rw_setup()
> 
> Remove unnecessary call to iov_iter_save_state() in io_prep_rw_setup() as
> io_import_iovec() already does this. Then the result from
> io_import_iovec() can be returned directly.
> 
> Signed-off-by: David Wei <dw@davidwei.uk>
> ---
>  io_uring/rw.c | 8 +-------
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/io_uring/rw.c b/io_uring/rw.c index 04e4467ab0ee..5b24fd8b69f6
> 100644
> --- a/io_uring/rw.c
> +++ b/io_uring/rw.c
> @@ -240,7 +240,6 @@ static int io_rw_alloc_async(struct io_kiocb *req)
> static int io_prep_rw_setup(struct io_kiocb *req, int ddir, bool do_import)  {
>  	struct io_async_rw *rw;
> -	int ret;
> 
>  	if (io_rw_alloc_async(req))
>  		return -ENOMEM;
> @@ -249,12 +248,7 @@ static int io_prep_rw_setup(struct io_kiocb *req, int
> ddir, bool do_import)
>  		return 0;
> 
>  	rw = req->async_data;
> -	ret = io_import_iovec(ddir, req, rw, 0);
> -	if (unlikely(ret < 0))
> -		return ret;
> -
> -	iov_iter_save_state(&rw->iter, &rw->iter_state);
> -	return 0;
> +	return io_import_iovec(ddir, req, rw, 0);
>  }
> 
>  static inline void io_meta_save_state(struct io_async_rw *io)
> --
> 2.43.5
> 

Look good to me. No logic changes, only compilation and testing.
Tested-by: Li Zetao <lizetao1@huawei.com>

  parent reply	other threads:[~2024-12-07  5:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-07  0:41 [PATCH for-next] io_uring: clean up io_prep_rw_setup() David Wei
2024-12-07  4:32 ` Anuj gupta
2024-12-07  5:19 ` lizetao [this message]
2024-12-07 15:16 ` Jens Axboe

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=62af3d54790b4b3f9a83234d6259ca97@huawei.com \
    --to=lizetao1@huawei.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=dw@davidwei.uk \
    --cc=io-uring@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox