diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-03-14 11:01:45 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-04-03 07:14:21 -0600 |
commit | 81cf17cd3ab3e5441e876a8e9e9c38ae9920cecb (patch) | |
tree | dd28fc758ba1bac8608c23ac1631a16778242009 /io_uring/kbuf.c | |
parent | 25a2c188a0a00b3d9f2057798aa86fe6b04377bf (diff) |
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 <deller@gmx.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'io_uring/kbuf.c')
-rw-r--r-- | io_uring/kbuf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/io_uring/kbuf.c b/io_uring/kbuf.c index db5f189267b7..4b2f4a0ee962 100644 --- a/io_uring/kbuf.c +++ b/io_uring/kbuf.c @@ -494,7 +494,9 @@ int io_register_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) if (copy_from_user(®, arg, sizeof(reg))) return -EFAULT; - if (reg.pad || reg.resv[0] || reg.resv[1] || reg.resv[2]) + if (reg.resv[0] || reg.resv[1] || reg.resv[2]) + return -EINVAL; + if (reg.flags) return -EINVAL; if (!reg.ring_addr) return -EFAULT; @@ -544,7 +546,9 @@ int io_unregister_pbuf_ring(struct io_ring_ctx *ctx, void __user *arg) if (copy_from_user(®, arg, sizeof(reg))) return -EFAULT; - if (reg.pad || reg.resv[0] || reg.resv[1] || reg.resv[2]) + if (reg.resv[0] || reg.resv[1] || reg.resv[2]) + return -EINVAL; + if (reg.flags) return -EINVAL; bl = io_buffer_get_list(ctx, reg.bgid); |