summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-09-24 21:59:41 +0100
committerJens Axboe <axboe@kernel.dk>2021-10-19 05:49:53 -0600
commit6878b40e7b28bd780dedb7d505c13dbf82b73290 (patch)
treee229f061f5f1721d1ee7e0267391768d26640a0e /fs/io_uring.c
parent8d4af6857c6fb5b1922218e93052bee29eb540f4 (diff)
downloadlwn-6878b40e7b28bd780dedb7d505c13dbf82b73290.tar.gz
lwn-6878b40e7b28bd780dedb7d505c13dbf82b73290.zip
io_uring: mark having different creds unlikely
Hint the compiler that it's not as likely to have creds different from current attached to a request. The current code generation is far from ideal, hopefully it can help to some compilers to remove duplicated jump tables and so. Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/e7815251ac4bf5a4a23d298c752f029ae19f3837.1632516769.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 3ced6a7bdf2b..bda302bedeef 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -6638,7 +6638,7 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
const struct cred *creds = NULL;
int ret;
- if ((req->flags & REQ_F_CREDS) && req->creds != current_cred())
+ if (unlikely((req->flags & REQ_F_CREDS) && req->creds != current_cred()))
creds = override_creds(req->creds);
switch (req->opcode) {