From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Dave Chinner <david@fromorbit.com>, Jan Kara <jack@suse.cz>,
linux-fsdevel@vger.kernel.org, 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 07:47:18 -0700 [thread overview]
Message-ID: <20191010144718.GI13108@magnolia> (raw)
In-Reply-To: <20191010075420.GA28344@infradead.org>
On Thu, Oct 10, 2019 at 12:54:20AM -0700, Christoph Hellwig wrote:
> 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.
<shrug> I'd just add the 'bool wait' parameter at the end of
iomap_dio_rw() and leave it that way. If we ever develop more than one
caller that passes in "is_sync_kiocb(iocb)" (or more than two lucky
callers screwing it up I guess?) for that parameter then maybe we can
re-evaluate.
--D
next prev parent reply other threads:[~2019-10-10 14: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
2019-10-10 14:47 ` Darrick J. Wong [this message]
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=20191010144718.GI13108@magnolia \
--to=darrick.wong@oracle.com \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--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).