io_uring/kbuf: use 'bl' directly rather than req->buf_list
authorJens Axboe <axboe@kernel.dk>
Thu, 8 Aug 2024 16:33:16 +0000 (10:33 -0600)
committerJens Axboe <axboe@kernel.dk>
Sun, 25 Aug 2024 14:27:01 +0000 (08:27 -0600)
req->buf_list is assigned higher up and is safe to use as we remain
within a locked region, as is the 'bl' variable itself from which it
was assigned. To improve readability, use 'bl' directly rather than
get it from the io_kiocb, if we need to increment the head directly
in the buffer selection path. This makes it readily apparent that
it's the same io_buffer_list being used.

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

index 1af2bd56af44ac496fd56f327e596730844ceb3f..c61dd60113f7e2aee2219cc83124d9146abcb72a 100644 (file)
@@ -298,7 +298,7 @@ int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,
                 */
                if (ret > 0) {
                        req->flags |= REQ_F_BL_NO_RECYCLE;
-                       req->buf_list->head += ret;
+                       bl->head += ret;
                }
        } else {
                ret = io_provided_buffers_select(req, &arg->out_len, bl, arg->iovs);