summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-01-19 13:32:41 +0000
committerJens Axboe <axboe@kernel.dk>2021-02-01 10:02:42 -0700
commit02b23a9af5ba4db0a85ebb81c8b376b2fe860d0f (patch)
treed91318a64d3b0fca3dbd6571ec769ce2c6d86a52
parent85bcb6c67ea145b8032089db891218e3339cbdb8 (diff)
downloadlinux-stable-02b23a9af5ba4db0a85ebb81c8b376b2fe860d0f.tar.gz
linux-stable-02b23a9af5ba4db0a85ebb81c8b376b2fe860d0f.tar.bz2
linux-stable-02b23a9af5ba4db0a85ebb81c8b376b2fe860d0f.zip
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: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 9ff84ceff4f9..c3e0d6246d71 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -2815,16 +2815,12 @@ static void io_iopoll_req_issued(struct io_kiocb *req, bool in_async)
wake_up(&ctx->sq_data->wait);
}
-static inline void __io_state_file_put(struct io_submit_state *state)
-{
- fput_many(state->file, state->file_refs);
- 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);
+ if (state->file_refs) {
+ fput_many(state->file, state->file_refs);
+ state->file_refs = 0;
+ }
}
/*
@@ -2842,7 +2838,7 @@ static struct file *__io_file_get(struct io_submit_state *state, int fd)
state->file_refs--;
return state->file;
}
- __io_state_file_put(state);
+ io_state_file_put(state);
}
state->file = fget_many(fd, state->ios_left);
if (unlikely(!state->file))