Re: [PATCH 13/16] io_uring: add support for pre-mapped user IO buffers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 15, 2019 at 3:56 AM Jens Axboe <axboe@xxxxxxxxx> wrote:

> diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
> index 542757a4c898..e36c264d74e8 100644
> --- a/include/linux/syscalls.h
> +++ b/include/linux/syscalls.h
> @@ -314,6 +314,8 @@ asmlinkage long sys_io_uring_setup(u32 entries,
>                                 struct io_uring_params __user *p);
>  asmlinkage long sys_io_uring_enter(unsigned int fd, u32 to_submit,
>                                 u32 min_complete, u32 flags);
> +asmlinkage long sys_io_uring_register(unsigned int fd, unsigned op,
> +                               void __user *arg);
>

Would it be possible to make this a typed pointer instead? If this needs to
be extended later to pass a different structure, a new system call may
be better for consistency than overloading the argument in various
ways.

> + * io_uring_register(2) opcodes and arguments
> + */
> +#define IORING_REGISTER_BUFFERS                0
> +#define IORING_UNREGISTER_BUFFERS      1
> +
> +struct io_uring_register_buffers {
> +       union {
> +               struct iovec *iovecs;
> +               __u64 pad;
> +       };
> +       __u32 nr_iovecs;
> +};

As before, I'd suggest making this structure compatible between 32-bit
and 64-bit architectectures, by avoiding pointer and implied padding
fields.

      Arnd



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux