Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: move ctx->restricted check into io_check_restriction()

Just a cleanup, makes the code easier to read without too many dependent
nested checks.

Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+3 -1
+3 -1
io_uring/io_uring.c
··· 2056 2056 struct io_kiocb *req, 2057 2057 unsigned int sqe_flags) 2058 2058 { 2059 + if (!ctx->restricted) 2060 + return true; 2059 2061 if (!test_bit(req->opcode, ctx->restrictions.sqe_op)) 2060 2062 return false; 2061 2063 ··· 2160 2158 } 2161 2159 } 2162 2160 if (unlikely(ctx->restricted || ctx->drain_active || ctx->drain_next)) { 2163 - if (ctx->restricted && !io_check_restriction(ctx, req, sqe_flags)) 2161 + if (!io_check_restriction(ctx, req, sqe_flags)) 2164 2162 return io_init_fail_req(req, -EACCES); 2165 2163 /* knock it to the slow queue path, will be drained there */ 2166 2164 if (ctx->drain_active)