Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

David Wei and committed by
Jens Axboe
2e6406a2 febfbf76

+1 -7
+1 -7
io_uring/rw.c
··· 240 240 static int io_prep_rw_setup(struct io_kiocb *req, int ddir, bool do_import) 241 241 { 242 242 struct io_async_rw *rw; 243 - int ret; 244 243 245 244 if (io_rw_alloc_async(req)) 246 245 return -ENOMEM; ··· 248 249 return 0; 249 250 250 251 rw = req->async_data; 251 - ret = io_import_iovec(ddir, req, rw, 0); 252 - if (unlikely(ret < 0)) 253 - return ret; 254 - 255 - iov_iter_save_state(&rw->iter, &rw->iter_state); 256 - return 0; 252 + return io_import_iovec(ddir, req, rw, 0); 257 253 } 258 254 259 255 static inline void io_meta_save_state(struct io_async_rw *io)