io_uring/kbuf: cleanup passing back cflags
authorJens Axboe <axboe@kernel.dk>
Tue, 30 Jan 2024 03:59:18 +0000 (20:59 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 8 Feb 2024 20:27:06 +0000 (13:27 -0700)
commit8435c6f380d622639d8acbc0af585d941396fa57
treefd6ef35de4c6faf1fead3ba35d31027643f54e95
parent949249e25f1098315a971b70b893c1a2e2e4a819
io_uring/kbuf: cleanup passing back cflags

We have various functions calculating the CQE cflags we need to pass
back, but it's all the same everywhere. Make a number of the putting
functions void, and just have the two main helps for this, io_put_kbuf()
and io_put_kbuf_comp() calculate the actual mask and pass it back.

While at it, cleanup how we put REQ_F_BUFFER_RING buffers. Before
this change, we would call into __io_put_kbuf() only to go right back
in to the header defined functions. As clearing this type of buffer
is just re-assigning the buf_index and incrementing the head, this
is very wasteful.

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