Skip to content

Commit

Permalink
io_uring: drop io_file_put() 'file' argument
Browse files Browse the repository at this point in the history
Since the fget/fput handling was reworked in commit 09bb839, we
never call io_file_put() with state == NULL (and hence file != NULL)
anymore. Remove that case.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed Apr 14, 2019
1 parent 77f1e0a commit 3d6770f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,11 +682,9 @@ static void io_iopoll_req_issued(struct io_kiocb *req)
list_add_tail(&req->list, &ctx->poll_list);
}

static void io_file_put(struct io_submit_state *state, struct file *file)
static void io_file_put(struct io_submit_state *state)
{
if (!state) {
fput(file);
} else if (state->file) {
if (state->file) {
int diff = state->has_refs - state->used_refs;

if (diff)
Expand All @@ -711,7 +709,7 @@ static struct file *io_file_get(struct io_submit_state *state, int fd)
state->ios_left--;
return state->file;
}
io_file_put(state, NULL);
io_file_put(state);
}
state->file = fget_many(fd, state->ios_left);
if (!state->file)
Expand Down Expand Up @@ -1671,7 +1669,7 @@ static int io_submit_sqe(struct io_ring_ctx *ctx, struct sqe_submit *s,
static void io_submit_state_end(struct io_submit_state *state)
{
blk_finish_plug(&state->plug);
io_file_put(state, NULL);
io_file_put(state);
if (state->free_reqs)
kmem_cache_free_bulk(req_cachep, state->free_reqs,
&state->reqs[state->cur_req]);
Expand Down

0 comments on commit 3d6770f

Please sign in to comment.