diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-02-11 19:28:23 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-02-11 19:42:19 +0100 |
commit | 2f8e45f16c57360dd4d8b1310c2952a29a8fa890 (patch) | |
tree | c2f2ab749ada9f00fe4a9a9ebd4f17b0604efcb2 /fs | |
parent | io_uring: move res check out of io_rw_reissue() (diff) | |
download | linux-2f8e45f16c57360dd4d8b1310c2952a29a8fa890.tar.xz linux-2f8e45f16c57360dd4d8b1310c2952a29a8fa890.zip |
io_uring: inline io_complete_rw_common()
__io_complete_rw() casts request to kiocb for it to be immediately
container_of()'ed by io_complete_rw_common(). And the last function's name
doesn't do a great job of illuminating its purposes, so just inline it in
its only user.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index c873ec113bcc..7b1979624320 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -2761,22 +2761,6 @@ static void kiocb_end_write(struct io_kiocb *req) file_end_write(req->file); } -static void io_complete_rw_common(struct kiocb *kiocb, long res, - unsigned int issue_flags) -{ - struct io_kiocb *req = container_of(kiocb, struct io_kiocb, rw.kiocb); - int cflags = 0; - - if (kiocb->ki_flags & IOCB_WRITE) - kiocb_end_write(req); - - if (res != req->result) - req_set_fail_links(req); - if (req->flags & REQ_F_BUFFER_SELECTED) - cflags = io_put_rw_kbuf(req); - __io_req_complete(req, issue_flags, res, cflags); -} - #ifdef CONFIG_BLOCK static bool io_resubmit_prep(struct io_kiocb *req) { @@ -2840,10 +2824,18 @@ static bool io_rw_reissue(struct io_kiocb *req) static void __io_complete_rw(struct io_kiocb *req, long res, long res2, unsigned int issue_flags) { + int cflags = 0; + if ((res == -EAGAIN || res == -EOPNOTSUPP) && io_rw_reissue(req)) return; + if (res != req->result) + req_set_fail_links(req); - io_complete_rw_common(&req->rw.kiocb, res, issue_flags); + if (req->rw.kiocb.ki_flags & IOCB_WRITE) + kiocb_end_write(req); + if (req->flags & REQ_F_BUFFER_SELECTED) + cflags = io_put_rw_kbuf(req); + __io_req_complete(req, issue_flags, res, cflags); } static void io_complete_rw(struct kiocb *kiocb, long res, long res2) |