]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
io_uring: introduce io_is_compat()
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 24 Feb 2025 12:42:19 +0000 (12:42 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 24 Feb 2025 14:34:21 +0000 (07:34 -0700)
A preparation patch adding a simple helper for gauging the compat state.
It'll help us to optimise and compile out more code in the following
commits.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Link: https://lore.kernel.org/r/1a87a640265196a67bc38300128e0bfd7839ab1f.1740400452.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.h

index 6c46d9cdd7aa828d08dae95d9a309f552bb1ac4f..d5c9b7a6911d0d915190f740cf8a55aa7cfdc360 100644 (file)
@@ -147,6 +147,11 @@ static inline void io_lockdep_assert_cq_locked(struct io_ring_ctx *ctx)
 #endif
 }
 
+static inline bool io_is_compat(struct io_ring_ctx *ctx)
+{
+       return IS_ENABLED(CONFIG_COMPAT) && unlikely(ctx->compat);
+}
+
 static inline void io_req_task_work_add(struct io_kiocb *req)
 {
        __io_req_task_work_add(req, 0);