On 1/9/19 11:30 AM, Christoph Hellwig wrote:
> On Wed, Jan 09, 2019 at 08:53:31AM -0700, Jens Axboe wrote:
>>>> +static int io_setup_rw(int rw, const struct io_uring_iocb *iocb,
>>>> + struct iovec **iovec, struct iov_iter *iter)
>>>> +{
>>>> + void __user *buf = (void __user *)(uintptr_t)iocb->addr;
>>>> + size_t ret;
>>>> +
>>>> + ret = import_single_range(rw, buf, iocb->len, *iovec, iter);
>>>> + *iovec = NULL;
>>>> + return ret;
>>>> +}
>>>
>>> Is there any point in supporting non-vectored operations here?
>>
>> Not sure I follow?
>
> This version only supports non-vectored read and write, that is
> the equivalent of pread/pwrite. Many AIO users really need vectored
> operations, that is preadv/pwritev semantics indirecting through
> a struct iovec array. The non-vectored version can be trivially
> emulated using a vector of 1, which is what we do in the kernel
> I/O stack everywhere. So I think we should just support the vectored
> version here, and not the non-vectored one. See my io_uring branch
> for the sketeched implementation.
OK, I see what you mean, so only supported the vectored version.
Probably makes more sense, I'll make the change.
--
Jens Axboe