Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1170347

Re: [PATCH v5 5/5] block: loop: support DIO & AIO

From Ming Lei <ming.lei@canonical.com>
Newsgroups linux.kernel
Subject Re: [PATCH v5 5/5] block: loop: support DIO & AIO
Date 2015-06-23 05:00 +0200
Message-ID <pEmBj-6p4-3@gated-at.bofh.it> (permalink)
References <pzs4G-8fW-17@gated-at.bofh.it> <pzsem-8tG-37@gated-at.bofh.it> <pzIVR-7Zu-39@gated-at.bofh.it> <pE8RH-3oF-1@gated-at.bofh.it> <pEcsh-7v-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 23, 2015 at 12:00 AM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Jun 22, 2015 at 08:09:55PM +0800, Ming Lei wrote:
>> For the general async interface, it is a bit complicated than sync interfaces:
>>
>> -  iocb need to be one parameter, because it often depends on callers, such
>> as loop can preallocate it
>> - direct I/O need to be another parameter(in loop we can use the same helper
>> to handle sync request)
>> - bvec and the segment number are another two parameters
>> - not mention the common parameters(file, offset, pos, complete...)
>
> We only really need iocb + iov_iter, they carry everything we need.

Then the helper becomes the fowllowing:

ssize_t vfs_iter_async_write(struct kiocb *kiocb, struct iov_iter *iter)
{
       ssize_t ret;

       iter->type |= WRITE;
       ret = file->f_op->write_iter(&kiocb, iter);

       return ret;
}

I am wondering its value and we can do that easily in call site, also it isn't
easy to name it since sometimes we may need to let the helper handle
sync requests, such as loop's case.

Thanks,
Ming
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH v5 5/5] block: loop: support DIO & AIO Ming Lei <ming.lei@canonical.com> - 2015-06-22 14:20 +0200
  Re: [PATCH v5 5/5] block: loop: support DIO & AIO Ming Lei <ming.lei@canonical.com> - 2015-06-23 05:00 +0200

csiph-web