Commit 02b23a9a authored by Pavel Begunkov's avatar Pavel Begunkov Committed by Jens Axboe

io_uring: remove __io_state_file_put

The check in io_state_file_put() is optimised pretty well when called
from __io_file_get(). Don't pollute the code with all these variants.
Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 85bcb6c6
...@@ -2815,16 +2815,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req, bool in_async) ...@@ -2815,16 +2815,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req, bool in_async)
wake_up(&ctx->sq_data->wait); wake_up(&ctx->sq_data->wait);
} }
static inline void __io_state_file_put(struct io_submit_state *state) static inline void io_state_file_put(struct io_submit_state *state)
{ {
if (state->file_refs) {
fput_many(state->file, state->file_refs); fput_many(state->file, state->file_refs);
state->file_refs = 0; state->file_refs = 0;
} }
static inline void io_state_file_put(struct io_submit_state *state)
{
if (state->file_refs)
__io_state_file_put(state);
} }
/* /*
...@@ -2842,7 +2838,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd) ...@@ -2842,7 +2838,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd)
state->file_refs--; state->file_refs--;
return state->file; return state->file;
} }
__io_state_file_put(state); io_state_file_put(state);
} }
state->file = fget_many(fd, state->ios_left); state->file = fget_many(fd, state->ios_left);
if (unlikely(!state->file)) if (unlikely(!state->file))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment