]> git.baikalelectronics.ru Git - kernel.git/commit
io_uring: eliminate the need to track provided buffer ID separately
authorJens Axboe <axboe@kernel.dk>
Sun, 1 May 2022 18:08:35 +0000 (12:08 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 May 2022 12:29:06 +0000 (06:29 -0600)
commit09207f67bcbb84bc9317ea9e55da71c64dccf0d1
tree94a567c70a5807befeb457391884e7fd7962898c
parent7b67be93167df6fcea6a1d8bf8fec1f53027f500
io_uring: eliminate the need to track provided buffer ID separately

We have io_kiocb->buf_index which is used for either fixed buffers, or
for provided buffers. For the latter, it's used to hold the buffer group
ID for buffer selection. Post selection, req->kbuf->bid is used to get
the buffer ID.

Store the buffer ID, when selected, in req->buf_index. If we do end up
recycling the buffer, reset it back to the buffer group ID.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c