projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
93f052c
)
io_uring: refactor io_assign_file error path
author
Pavel Begunkov
<asml.silence@gmail.com>
Mon, 18 Apr 2022 19:51:12 +0000
(20:51 +0100)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 25 Apr 2022 00:02:52 +0000
(18:02 -0600)
All io_assign_file() callers do error handling themselves,
req_set_fail() in the io_assign_file()'s fail path needlessly bloats the
kernel and is not the best abstraction to have. Simplify the error path.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link:
https://lore.kernel.org/r/eff77fb1eac2b6a90cca5223813e6a396ffedec0.1650311386.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c
patch
|
blob
|
history
diff --git
a/fs/io_uring.c
b/fs/io_uring.c
index 1b8597b82f6ad100efd735cb065c1badfa16ee35..75be769ce652184df627fed97e85728393854e4a 100644
(file)
--- a/
fs/io_uring.c
+++ b/
fs/io_uring.c
@@
-7134,12
+7134,8
@@
static bool io_assign_file(struct io_kiocb *req, unsigned int issue_flags)
req->file = io_file_get_fixed(req, req->cqe.fd, issue_flags);
else
req->file = io_file_get_normal(req, req->cqe.fd);
- if (req->file)
- return true;
- req_set_fail(req);
- req->cqe.res = -EBADF;
- return false;
+ return !!req->file;
}
static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)