summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-04-15 22:08:32 +0100
committerJens Axboe <axboe@kernel.dk>2022-04-24 18:02:52 -0600
commit17b147f6c1f21caef554004e19207810cbc08a8e (patch)
treebd8201010b4619ebdba9ea2e885b9856dc0c5aba
parent924a07e482baae0ced5fb9922b827c46f0c0972d (diff)
downloadlinux-17b147f6c1f21caef554004e19207810cbc08a8e.tar.gz
linux-17b147f6c1f21caef554004e19207810cbc08a8e.tar.bz2
linux-17b147f6c1f21caef554004e19207810cbc08a8e.zip
io_uring: inline io_req_complete_fail_submit()
Inline io_req_complete_fail_submit(), there is only one caller and the name doesn't tell us much. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/fe5851af01dcd39fc84b71b8539c7cbe4658fb6d.1650056133.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index fe9df32be921..5bb46fe161c1 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2223,17 +2223,6 @@ static void io_req_complete_failed(struct io_kiocb *req, s32 res)
io_req_complete_post(req, res, io_put_kbuf(req, IO_URING_F_UNLOCKED));
}
-static void io_req_complete_fail_submit(struct io_kiocb *req)
-{
- /*
- * We don't submit, fail them all, for that replace hardlinks with
- * normal links. Extra REQ_F_LINK is tolerated.
- */
- req->flags &= ~REQ_F_HARDLINK;
- req->flags |= REQ_F_LINK;
- io_req_complete_failed(req, req->cqe.res);
-}
-
/*
* Don't initialise the fields below on every allocation, but do that in
* advance and keep them valid across allocations.
@@ -7564,8 +7553,14 @@ static inline void io_queue_sqe(struct io_kiocb *req)
static void io_queue_sqe_fallback(struct io_kiocb *req)
__must_hold(&req->ctx->uring_lock)
{
- if (req->flags & REQ_F_FAIL) {
- io_req_complete_fail_submit(req);
+ if (unlikely(req->flags & REQ_F_FAIL)) {
+ /*
+ * We don't submit, fail them all, for that replace hardlinks
+ * with normal links. Extra REQ_F_LINK is tolerated.
+ */
+ req->flags &= ~REQ_F_HARDLINK;
+ req->flags |= REQ_F_LINK;
+ io_req_complete_failed(req, req->cqe.res);
} else if (unlikely(req->ctx->drain_active)) {
io_drain_req(req);
} else {