Skip to content

Commit 81cf17c

Browse files
committed
io_uring/kbuf: rename struct io_uring_buf_reg 'pad' to'flags'
In preparation for allowing flags to be set for registration, rename the padding and use it for that. Acked-by: Helge Deller <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 25a2c18 commit 81cf17c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

include/uapi/linux/io_uring.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ struct io_uring_buf_reg {
640640
__u64 ring_addr;
641641
__u32 ring_entries;
642642
__u16 bgid;
643-
__u16 pad;
643+
__u16 flags;
644644
__u64 resv[3];
645645
};
646646

io_uring/kbuf.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,9 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
494494
if (copy_from_user(&reg, arg, sizeof(reg)))
495495
return -EFAULT;
496496

497-
if (reg.pad || reg.resv[0] || reg.resv[1] || reg.resv[2])
497+
if (reg.resv[0] || reg.resv[1] || reg.resv[2])
498+
return -EINVAL;
499+
if (reg.flags)
498500
return -EINVAL;
499501
if (!reg.ring_addr)
500502
return -EFAULT;
@@ -544,7 +546,9 @@ int io_unregister_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg)
544546

545547
if (copy_from_user(&reg, arg, sizeof(reg)))
546548
return -EFAULT;
547-
if (reg.pad || reg.resv[0] || reg.resv[1] || reg.resv[2])
549+
if (reg.resv[0] || reg.resv[1] || reg.resv[2])
550+
return -EINVAL;
551+
if (reg.flags)
548552
return -EINVAL;
549553

550554
bl = io_buffer_get_list(ctx, reg.bgid);

0 commit comments

Comments
 (0)