Skip to content

Commit

Permalink
io_uring: don't clear req->kbuf when buffer selection is done
Browse files Browse the repository at this point in the history
It's not needed as the REQ_F_BUFFER_SELECTED flag tracks the state of
whether or not kbuf is valid, so just drop it.

Suggested-by: Dylan Yudaken <dylany@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Jens Axboe committed May 9, 2022
1 parent 1dbd023 commit 7ccba24
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -1463,7 +1463,6 @@ static unsigned int __io_put_kbuf(struct io_kiocb *req, struct list_head *list)
{
req->flags &= ~REQ_F_BUFFER_SELECTED;
list_add(&req->kbuf->list, list);
req->kbuf = NULL;

return IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
}
Expand Down Expand Up @@ -1540,7 +1539,6 @@ static void io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags)
list_add(&buf->list, &bl->buf_list);
req->flags &= ~REQ_F_BUFFER_SELECTED;
req->buf_index = buf->bgid;
req->kbuf = NULL;

io_ring_submit_unlock(ctx, issue_flags);
}
Expand Down

0 comments on commit 7ccba24

Please sign in to comment.