linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ming Lei <ming.lei@canonical.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dave Kleikamp <dave.kleikamp@oracle.com>,
	Jens Axboe <axboe@kernel.dk>, Zach Brown <zab@zabbo.net>,
	Maxim Patlasov <mpatlasov@parallels.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Tejun Heo <tj@kernel.org>, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH v5 5/5] block: loop: support DIO & AIO
Date: Tue, 23 Jun 2015 10:59:36 +0800	[thread overview]
Message-ID: <CACVXFVNRkA9zFSHoTOvZAtzf6FQJVxfihRKE5C1bffXxsWGOnw@mail.gmail.com> (raw)
In-Reply-To: <20150622160002.GB10307@infradead.org>

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/

  reply	other threads:[~2015-06-23  2:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-09 13:49 [PATCH v5 0/5] block: loop: improve loop with AIO Ming Lei
2015-06-09 13:49 ` [PATCH v5 1/5] fs: direct-io: don't dirtying pages for ITER_BVEC/ITER_KVEC direct read Ming Lei
2015-06-10  7:35   ` Christoph Hellwig
2015-06-09 13:49 ` [PATCH v5 2/5] block: loop: set QUEUE_FLAG_NOMERGES for request queue of loop Ming Lei
2015-06-10  7:36   ` Christoph Hellwig
2015-06-22  6:32     ` Ming Lei
2015-06-09 13:49 ` [PATCH v5 3/5] block: loop: use kthread_work Ming Lei
2015-06-09 13:49 ` [PATCH v5 4/5] block: loop: prepare for supporing direct IO Ming Lei
2015-06-10  7:40   ` Christoph Hellwig
2015-06-22 12:19     ` Ming Lei
2015-06-09 13:49 ` [PATCH v5 5/5] block: loop: support DIO & AIO Ming Lei
2015-06-10  7:46   ` Christoph Hellwig
2015-06-22 12:09     ` Ming Lei
2015-06-22 16:00       ` Christoph Hellwig
2015-06-23  2:59         ` Ming Lei [this message]
2015-06-23 12:43       ` Ming Lei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACVXFVNRkA9zFSHoTOvZAtzf6FQJVxfihRKE5C1bffXxsWGOnw@mail.gmail.com \
    --to=ming.lei@canonical.com \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=dave.kleikamp@oracle.com \
    --cc=david@fromorbit.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpatlasov@parallels.com \
    --cc=tj@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=zab@zabbo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).