From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org,
Christoph Hellwig <hch@infradead.org>,
darrick.wong@oracle.com, linux-xfs@vger.kernel.org,
Matthew Bobrowski <mbobrowski@mbobrowski.org>
Subject: Re: [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw()
Date: Thu, 10 Oct 2019 00:54:20 -0700 [thread overview]
Message-ID: <20191010075420.GA28344@infradead.org> (raw)
In-Reply-To: <20191009230227.GH16973@dread.disaster.area>
On Thu, Oct 10, 2019 at 10:02:27AM +1100, Dave Chinner wrote:
> That would mean the callers need to do something like this by
> default:
>
> ret = iomap_dio_rw(iocb, iter, ops, dops, is_sync_kiocb(iocb));
>
> And filesystems like XFS will need to do:
>
> ret = iomap_dio_rw(iocb, iter, ops, dops,
> is_sync_kiocb(iocb) || unaligned);
>
> and ext4 will calculate the parameter in whatever way it needs to.
I defintively like that.
>
> In fact, it may be that a wrapper function is better for existing
> callers:
>
> static inline ssize_t iomap_dio_rw()
> {
> return iomap_dio_rw_wait(iocb, iter, ops, dops, is_sync_kiocb(iocb));
> }
>
> And XFS/ext4 writes call iomap_dio_rw_wait() directly. That way we
> don't need to change the read code at all...
I have to say I really hated the way we were growing all these wrappers
in the old direct I/O code, so I've been asked Jan to not add the
wrapper in his old version. But compared to the force_sync version it
at least makes a little more sense here. I'm just not sure if
iomap_dio_rw_wait is the right name, but the __-prefix convention for
non-trivial differences also sucks. I can't think of a better name,
though.
next prev parent reply other threads:[~2019-10-10 7:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-09 20:41 [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw() Jan Kara
2019-10-09 20:41 ` [PATCH 1/2] iomap: Allow forcing of waiting for running DIO " Jan Kara
2019-10-09 20:41 ` [PATCH 2/2] xfs: Use iomap_dio_rw_wait() Jan Kara
2019-10-09 23:02 ` [PATCH 0/2] iomap: Waiting for IO in iomap_dio_rw() Dave Chinner
2019-10-10 7:54 ` Christoph Hellwig [this message]
2019-10-10 14:47 ` Darrick J. Wong
2019-10-10 15:09 ` Jan Kara
2019-10-10 9:18 ` Jan Kara
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=20191010075420.GA28344@infradead.org \
--to=hch@infradead.org \
--cc=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=jack@suse.cz \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mbobrowski@mbobrowski.org \
/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).