From: Jan Kara <jack@suse.cz>
To: <linux-fsdevel@vger.kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
darrick.wong@oracle.com, <linux-xfs@vger.kernel.org>,
Matthew Bobrowski <mbobrowski@mbobrowski.org>,
Jan Kara <jack@suse.cz>
Subject: [PATCH 2/2] xfs: Use iomap_dio_rw_wait()
Date: Wed, 9 Oct 2019 22:41:26 +0200 [thread overview]
Message-ID: <20191009204130.15974-2-jack@suse.cz> (raw)
In-Reply-To: <20191009202736.19227-1-jack@suse.cz>
Use iomap_dio_rw() to wait for unaligned direct IO instead of opencoding
the wait.
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/xfs/xfs_file.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index 7d0dc21c14ca..f35cea628bed 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -547,16 +547,12 @@ xfs_file_dio_aio_write(
}
trace_xfs_file_direct_write(ip, count, iocb->ki_pos);
- ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops,
- false);
-
/*
- * If unaligned, this is the only IO in-flight. If it has not yet
- * completed, wait on it before we release the iolock to prevent
- * subsequent overlapping IO.
+ * If unaligned, this is the only IO in-flight. Wait on it before we
+ * release the iolock to prevent subsequent overlapping IO.
*/
- if (ret == -EIOCBQUEUED && unaligned_io)
- inode_dio_wait(inode);
+ ret = iomap_dio_rw(iocb, from, &xfs_iomap_ops, &xfs_dio_write_ops,
+ unaligned_io);
out:
xfs_iunlock(ip, iolock);
--
2.16.4
next prev parent reply other threads:[~2019-10-09 20:41 UTC|newest]
Thread overview: 12+ 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 ` Jan Kara [this message]
2019-10-09 23:02 ` [PATCH 0/2] iomap: Waiting for IO " Dave Chinner
2019-10-10 7:54 ` Christoph Hellwig
2019-10-10 14:47 ` Darrick J. Wong
2019-10-10 15:09 ` Jan Kara
2019-10-10 9:18 ` Jan Kara
2019-10-11 14:14 [PATCH 0/2 v2] " Jan Kara
2019-10-11 14:14 ` [PATCH 2/2] xfs: Use iomap_dio_rw_wait() Jan Kara
2019-10-11 15:28 ` Darrick J. Wong
2019-10-14 8:26 [PATCH 0/2 v3] iomap: Waiting for IO in iomap_dio_rw() Jan Kara
2019-10-14 8:26 ` [PATCH 2/2] xfs: Use iomap_dio_rw_wait() Jan Kara
2019-10-14 8:41 ` Christoph Hellwig
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=20191009204130.15974-2-jack@suse.cz \
--to=jack@suse.cz \
--cc=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--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).