Skip to content

Commit 2e6406a

Browse files
spikehaxboe
authored andcommitted
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> Reviewed-by: Anuj Gupta <anuj20.g@samsung.com> Tested-by: Li Zetao <lizetao1@huawei.com> Link: https://lore.kernel.org/r/20241207004144.783631-1-dw@davidwei.uk Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent febfbf7 commit 2e6406a

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

io_uring/rw.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ static int io_rw_alloc_async(struct io_kiocb *req)
240240
static int io_prep_rw_setup(struct io_kiocb *req, int ddir, bool do_import)
241241
{
242242
struct io_async_rw *rw;
243-
int ret;
244243

245244
if (io_rw_alloc_async(req))
246245
return -ENOMEM;
@@ -249,12 +248,7 @@ static int io_prep_rw_setup(struct io_kiocb *req, int ddir, bool do_import)
249248
return 0;
250249

251250
rw = req->async_data;
252-
ret = io_import_iovec(ddir, req, rw, 0);
253-
if (unlikely(ret < 0))
254-
return ret;
255-
256-
iov_iter_save_state(&rw->iter, &rw->iter_state);
257-
return 0;
251+
return io_import_iovec(ddir, req, rw, 0);
258252
}
259253

260254
static inline void io_meta_save_state(struct io_async_rw *io)

0 commit comments

Comments
 (0)