Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring: return void from io_put_kbuf_comp()

The only caller doesn't handle the return value of io_put_kbuf_comp(), so
change its return type into void.

Also follow Jens's suggestion to rename it as io_put_kbuf_drop().

Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20240407132759.4056167-1-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Ming Lei and committed by
Jens Axboe
bbbef3e9 c29006a2

+3 -7
+1 -1
io_uring/io_uring.c
··· 381 381 { 382 382 if (req->flags & REQ_F_BUFFER_SELECTED) { 383 383 spin_lock(&req->ctx->completion_lock); 384 - io_put_kbuf_comp(req); 384 + io_kbuf_drop(req); 385 385 spin_unlock(&req->ctx->completion_lock); 386 386 } 387 387
+2 -6
io_uring/kbuf.h
··· 120 120 } 121 121 } 122 122 123 - static inline unsigned int io_put_kbuf_comp(struct io_kiocb *req) 123 + static inline void io_kbuf_drop(struct io_kiocb *req) 124 124 { 125 - unsigned int ret; 126 - 127 125 lockdep_assert_held(&req->ctx->completion_lock); 128 126 129 127 if (!(req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING))) 130 - return 0; 128 + return; 131 129 132 - ret = IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT); 133 130 __io_put_kbuf_list(req, &req->ctx->io_buffers_comp); 134 - return ret; 135 131 } 136 132 137 133 static inline unsigned int io_put_kbuf(struct io_kiocb *req,