io_uring: return void from io_put_kbuf_comp()
authorMing Lei <ming.lei@redhat.com>
Sun, 7 Apr 2024 13:27:59 +0000 (21:27 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Apr 2024 14:10:26 +0000 (08:10 -0600)
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>
io_uring/io_uring.c
io_uring/kbuf.h

index 9d389bd89006c038851e43a007f9b20167789cc2..b7984442dd84ea99b98dd7231d9a5b17ad7af2cf 100644 (file)
@@ -381,7 +381,7 @@ static void io_clean_op(struct io_kiocb *req)
 {
        if (req->flags & REQ_F_BUFFER_SELECTED) {
                spin_lock(&req->ctx->completion_lock);
-               io_put_kbuf_comp(req);
+               io_kbuf_drop(req);
                spin_unlock(&req->ctx->completion_lock);
        }
 
index 53c141d9a8b2689d4db1a8dc4d99775a31d78190..5a9635ee021738c78f10c097b0ac9fc6e30f64fe 100644 (file)
@@ -120,18 +120,14 @@ static inline void __io_put_kbuf_list(struct io_kiocb *req,
        }
 }
 
-static inline unsigned int io_put_kbuf_comp(struct io_kiocb *req)
+static inline void io_kbuf_drop(struct io_kiocb *req)
 {
-       unsigned int ret;
-
        lockdep_assert_held(&req->ctx->completion_lock);
 
        if (!(req->flags & (REQ_F_BUFFER_SELECTED|REQ_F_BUFFER_RING)))
-               return 0;
+               return;
 
-       ret = IORING_CQE_F_BUFFER | (req->buf_index << IORING_CQE_BUFFER_SHIFT);
        __io_put_kbuf_list(req, &req->ctx->io_buffers_comp);
-       return ret;
 }
 
 static inline unsigned int io_put_kbuf(struct io_kiocb *req,