linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 03/16] ext4: use is_xxx_kiocb instead  of filp->fl_flags
       [not found] <1428174805-853-1-git-send-email-dmonakhov@openvz.org>
@ 2015-04-04 19:13 ` Dmitry Monakhov
  0 siblings, 0 replies; only message in thread
From: Dmitry Monakhov @ 2015-04-04 19:13 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-fsdevel, viro, Dmitry Monakhov, linux-ext4

Cc: linux-ext4@vger.kernel.org
Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
---
 fs/ext4/file.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 598abbb..27cf1cc 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -95,7 +95,6 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	struct inode *inode = file_inode(iocb->ki_filp);
 	struct mutex *aio_mutex = NULL;
 	struct blk_plug plug;
-	int o_direct = io_is_direct(file);
 	int overwrite = 0;
 	size_t length = iov_iter_count(from);
 	ssize_t ret;
@@ -105,18 +104,17 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	 * Unaligned direct AIO must be serialized; see comment above
 	 * In the case of O_APPEND, assume that we must always serialize
 	 */
-	if (o_direct &&
+	if (is_direct_kiocb(iocb) &&
 	    ext4_test_inode_flag(inode, EXT4_INODE_EXTENTS) &&
 	    !is_sync_kiocb(iocb) &&
-	    (file->f_flags & O_APPEND ||
-	     ext4_unaligned_aio(inode, from, pos))) {
+	    (is_append_kiocb(iocb) || ext4_unaligned_aio(inode, from, pos))) {
 		aio_mutex = ext4_aio_mutex(inode);
 		mutex_lock(aio_mutex);
 		ext4_unwritten_wait(inode);
 	}
 
 	mutex_lock(&inode->i_mutex);
-	if (file->f_flags & O_APPEND)
+	if (is_append_kiocb(iocb))
 		iocb->ki_pos = pos = i_size_read(inode);
 
 	/*
@@ -138,7 +136,7 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 	}
 
 	iocb->private = &overwrite;
-	if (o_direct) {
+	if (is_direct_kiocb(iocb)) {
 		blk_start_plug(&plug);
 
 
@@ -182,7 +180,7 @@ ext4_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
 		if (err < 0)
 			ret = err;
 	}
-	if (o_direct)
+	if (is_direct_kiocb(iocb))
 		blk_finish_plug(&plug);
 
 errout:
-- 
1.7.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-04 19:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1428174805-853-1-git-send-email-dmonakhov@openvz.org>
2015-04-04 19:13 ` [PATCH 03/16] ext4: use is_xxx_kiocb instead of filp->fl_flags Dmitry Monakhov

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).