Skip to content

Commit 03e02e8

Browse files
committed
io_uring/kbuf: use 'bl' directly rather than req->buf_list
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 <[email protected]>
1 parent 7255cd8 commit 03e02e8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

io_uring/kbuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ int io_buffers_select(struct io_kiocb *req, struct buf_sel_arg *arg,
298298
*/
299299
if (ret > 0) {
300300
req->flags |= REQ_F_BL_NO_RECYCLE;
301-
req->buf_list->head += ret;
301+
bl->head += ret;
302302
}
303303
} else {
304304
ret = io_provided_buffers_select(req, &arg->out_len, bl, arg->iovs);

0 commit comments

Comments
 (0)