Skip to contentSkip to conversation

io_uring/kbuf: remove obsolete buf_nr_pages and update comments

PATCH Applied Joanne Koong 2 participants 2 messages Nov 20, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring/kbuf: remove obsolete buf_nr_pages and update comments

The buf_nr_pages field in io_buffer_list was previously used to determine whether the buffer list uses ring-provided buffers or classic provided buffers. This is now determined by checking the IOBL_BUF_RING flag.

Remove the buf_nr_pages field and update related comments.

---
 include/linux/io_uring_types.h | 4 ++--
 io_uring/kbuf.h                | 5 ++---
 2 files changed, 4 insertions(+), 5 deletions(-)
include/linux/io_uring_types.h +2 -2
index c2ea6280901d..e3aa54239a21 100644
@@ -328,8 +328,8 @@ struct io_ring_ctx {
 
 		/*
 		 * Modifications are protected by ->uring_lock and ->mmap_lock.
-		 * The flags, buf_pages and buf_nr_pages fields should be stable
-		 * once published.
+		 * The buffer list's io mapped region should be stable once
+		 * published.
 		 */
 		struct xarray		io_bl_xa;
 
io_uring/kbuf.h +2 -3
index ada382ff38d7..bf15e26520d3 100644
@@ -14,8 +14,8 @@ enum {
 
 struct io_buffer_list {
 	/*
-	 * If ->buf_nr_pages is set, then buf_pages/buf_ring are used. If not,
-	 * then these are classic provided buffers and ->buf_list is used.
+	 * If the IOBL_BUF_RING flag is set, then buf_ring is used. If not, then
+	 * these are classic provided buffers and ->buf_list is used.
 	 */
 	union {
 		struct list_head buf_list;
@@ -27,7 +27,6 @@ struct io_buffer_list {
 	__u16 bgid;
 
 	/* below is for ring provided buffers */
-	__u16 buf_nr_pages;
 	__u16 nr_entries;
 	__u16 head;
 	__u16 mask;
Signature · 1 line
2.47.3
maintainer Applied
#1 lore raw
Quoted 8 lines · Joanne Koong

The buf_nr_pages field in io_buffer_list was previously used to determine whether the buffer list uses ring-provided buffers or classic provided buffers. This is now determined by checking the IOBL_BUF_RING flag.

Remove the buf_nr_pages field and update related comments.

[...]

Applied, thanks!

[1/1] io_uring/kbuf: remove obsolete buf_nr_pages and update comments

      commit: 84692a1519b32d61ff882cf24a9eda900961acad

Best regards,

Signature · 1 line
Jens Axboe