summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.h
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2022-06-17 11:48:03 +0300
committerJens Axboe <axboe@kernel.dk>2022-07-25 03:39:14 +0300
commitae5735c69bf28fea0b8260a03caeb906319228a2 (patch)
tree52e5ccd79059a5864a05c50c44e42d5574feefa7 /io_uring/io_uring.h
parent68494a65d0e2de3d99b28ae050971b6161eabac0 (diff)
downloadlinux-ae5735c69bf28fea0b8260a03caeb906319228a2.tar.xz
io_uring: deduplicate __io_fill_cqe_req tracing
Deduplicate two trace_io_uring_complete() calls in __io_fill_cqe_req(). Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/277ed85dba5189ab7d932164b314013a0f0b0fdc.1655455613.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/io_uring.h')
-rw-r--r--io_uring/io_uring.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h
index 88c64a69beaa..763915c66593 100644
--- a/io_uring/io_uring.h
+++ b/io_uring/io_uring.h
@@ -41,10 +41,12 @@ static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
{
struct io_uring_cqe *cqe;
- if (!(ctx->flags & IORING_SETUP_CQE32)) {
- trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
- req->cqe.res, req->cqe.flags, 0, 0);
+ trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
+ req->cqe.res, req->cqe.flags,
+ (req->flags & REQ_F_CQE32_INIT) ? req->extra1 : 0,
+ (req->flags & REQ_F_CQE32_INIT) ? req->extra2 : 0);
+ if (!(ctx->flags & IORING_SETUP_CQE32)) {
/*
* If we can't get a cq entry, userspace overflowed the
* submission (by quite a lot). Increment the overflow count in
@@ -63,9 +65,6 @@ static inline bool __io_fill_cqe_req(struct io_ring_ctx *ctx,
extra2 = req->extra2;
}
- trace_io_uring_complete(req->ctx, req, req->cqe.user_data,
- req->cqe.res, req->cqe.flags, extra1, extra2);
-
/*
* If we can't get a cq entry, userspace overflowed the
* submission (by quite a lot). Increment the overflow count in