io_uring/kbuf: refactor __io_remove_buffers
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 13 May 2025 17:26:50 +0000 (18:26 +0100)
committerJens Axboe <axboe@kernel.dk>
Tue, 13 May 2025 20:45:55 +0000 (14:45 -0600)
commitc724e801239ffc3714afe65cf6e721ddd04199d0
tree06b2f2fb50d374311e4a9597101604947dcc4543
parent52a05d0cf8f3b4569c525153132a90661c32fe11
io_uring/kbuf: refactor __io_remove_buffers

__io_remove_buffers used for two purposes, the first is removing
buffers for non ring based lists, which implies that it can be called
multiple times for the same list. And the second is for destroying
lists, which is not perfectly reentrable for ring based lists.

It's confusing, so just have a helper for the legacy pbuf buffer
removal, make sure it's not called for ring pbuf, and open code all ring
pbuf destruction into io_put_bl().

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/0ae416b099d311ad23f285cea02f2c94c8ae9a6c.1747150490.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/kbuf.c