* [Ocfs2-devel] [PATCH 6/7 v4] ocfs2: do not fallback to buffer I/O write if appending
@ 2014-10-11 12:31 WeiWei Wang
0 siblings, 0 replies; only message in thread
From: WeiWei Wang @ 2014-10-11 12:31 UTC (permalink / raw)
To: ocfs2-devel
Now we can do direct io and do not fallback to buffered IO any more
in case of append O_DIRECT write.
Signed-off-by: Weiwei Wang <wangww631@huawei.com>
Reviewed-by: Joseph Qi <joseph.qi@huawei.com>
---
fs/ocfs2/file.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 964d442..19e372f 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -2110,6 +2110,9 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
struct dentry *dentry = file->f_path.dentry;
struct inode *inode = dentry->d_inode;
loff_t saved_pos = 0, end;
+ struct ocfs2_super *osb = OCFS2_SB(inode->i_sb);
+ int full_coherency = !(osb->s_mount_opt &
+ OCFS2_MOUNT_COHERENCY_BUFFERED);
/*
* We start with a read level meta lock and only jump to an ex
@@ -2198,7 +2201,7 @@ static int ocfs2_prepare_inode_for_write(struct file *file,
* one node could wind up truncating another
* nodes writes.
*/
- if (end > i_size_read(inode)) {
+ if (end > i_size_read(inode) && !full_coherency) {
*direct_io = 0;
break;
}
--
1.8.4.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-10-11 12:31 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-11 12:31 [Ocfs2-devel] [PATCH 6/7 v4] ocfs2: do not fallback to buffer I/O write if appending WeiWei Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.