Skip to content

Commit 81b68a5

Browse files
isilenceaxboe
authored andcommitted
io_uring: deduplicate __io_complete_rw()
Call __io_complete_rw() in io_iopoll_queue() instead of hand coding it. Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 010e8e6 commit 81b68a5

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

fs/io_uring.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -891,7 +891,8 @@ enum io_mem_account {
891891
ACCT_PINNED,
892892
};
893893

894-
static bool io_rw_reissue(struct io_kiocb *req, long res);
894+
static void __io_complete_rw(struct io_kiocb *req, long res, long res2,
895+
struct io_comp_state *cs);
895896
static void io_cqring_fill_event(struct io_kiocb *req, long res);
896897
static void io_put_req(struct io_kiocb *req);
897898
static void io_double_put_req(struct io_kiocb *req);
@@ -902,8 +903,6 @@ static int __io_sqe_files_update(struct io_ring_ctx *ctx,
902903
struct io_uring_files_update *ip,
903904
unsigned nr_args);
904905
static int io_prep_work_files(struct io_kiocb *req);
905-
static void io_complete_rw_common(struct kiocb *kiocb, long res,
906-
struct io_comp_state *cs);
907906
static void __io_clean_op(struct io_kiocb *req);
908907
static int io_file_get(struct io_submit_state *state, struct io_kiocb *req,
909908
int fd, struct file **out_file, bool fixed);
@@ -1976,8 +1975,7 @@ static void io_iopoll_queue(struct list_head *again)
19761975
do {
19771976
req = list_first_entry(again, struct io_kiocb, inflight_entry);
19781977
list_del(&req->inflight_entry);
1979-
if (!io_rw_reissue(req, -EAGAIN))
1980-
io_complete_rw_common(&req->rw.kiocb, -EAGAIN, NULL);
1978+
__io_complete_rw(req, -EAGAIN, 0, NULL);
19811979
} while (!list_empty(again));
19821980
}
19831981

0 commit comments

Comments
 (0)