mirror of
https://github.com/torvalds/linux.git
synced 2025-11-03 10:10:33 +02:00
io_uring: don't clear req->kbuf when buffer selection is done
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>
This commit is contained in:
parent
1dbd023eb0
commit
7ccba24d3b
1 changed files with 0 additions and 2 deletions
|
|
@ -1463,7 +1463,6 @@ static unsigned int __io_put_kbuf(struct io_kiocb *req, struct list_head *list)
|
||||||
{
|
{
|
||||||
req->flags &= ~REQ_F_BUFFER_SELECTED;
|
req->flags &= ~REQ_F_BUFFER_SELECTED;
|
||||||
list_add(&req->kbuf->list, list);
|
list_add(&req->kbuf->list, list);
|
||||||
req->kbuf = NULL;
|
|
||||||
|
|
||||||
return IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
|
return IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
|
||||||
}
|
}
|
||||||
|
|
@ -1540,7 +1539,6 @@ static void io_kbuf_recycle(struct io_kiocb *req, unsigned issue_flags)
|
||||||
list_add(&buf->list, &bl->buf_list);
|
list_add(&buf->list, &bl->buf_list);
|
||||||
req->flags &= ~REQ_F_BUFFER_SELECTED;
|
req->flags &= ~REQ_F_BUFFER_SELECTED;
|
||||||
req->buf_index = buf->bgid;
|
req->buf_index = buf->bgid;
|
||||||
req->kbuf = NULL;
|
|
||||||
|
|
||||||
io_ring_submit_unlock(ctx, issue_flags);
|
io_ring_submit_unlock(ctx, issue_flags);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue