Commit 3b80cff5 authored by Jens Axboe's avatar Jens Axboe
Browse files

io_uring/kbuf: get rid of bl->is_ready



Now that xarray is being exclusively used for the buffer_list lookup,
this check is no longer needed. Get rid of it and the is_ready member.

Cc: stable@vger.kernel.org # v6.4+
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 09ab7eff
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ static int io_buffer_add_list(struct io_ring_ctx *ctx,
	 * always under the ->uring_lock, but the RCU lookup from mmap does.
	 */
	bl->bgid = bgid;
	smp_store_release(&bl->is_ready, 1);
	return xa_err(xa_store(&ctx->io_bl_xa, bgid, bl, GFP_KERNEL));
}

@@ -721,13 +720,6 @@ void *io_pbuf_get_address(struct io_ring_ctx *ctx, unsigned long bgid)

	if (!bl || !bl->is_mmap)
		return NULL;
	/*
	 * Ensure the list is fully setup. Only strictly needed for RCU lookup
	 * via mmap, and in that case only for the array indexed groups. For
	 * the xarray lookups, it's either visible and ready, or not at all.
	 */
	if (!smp_load_acquire(&bl->is_ready))
		return NULL;

	return bl->buf_ring;
}
+0 −2
Original line number Diff line number Diff line
@@ -29,8 +29,6 @@ struct io_buffer_list {
	__u8 is_buf_ring;
	/* ring mapped provided buffers, but mmap'ed by application */
	__u8 is_mmap;
	/* bl is visible from an RCU point of view for lookup */
	__u8 is_ready;
};

struct io_buffer {