aboutsummaryrefslogtreecommitdiff
path: root/fs/ocfs2/file.c
diff options
context:
space:
mode:
authorWengang Wang <wen.gang.wang@oracle.com>2010-02-09 14:57:45 +0800
committerJoel Becker <joel.becker@oracle.com>2010-02-26 15:41:07 -0800
commit96a1cc731adb28dc4feb71701091b80e67d486a7 (patch)
tree0220e211d3468b18e288d77bc828b6101adc9245 /fs/ocfs2/file.c
parentb89c54282db0c8634a2d2dc200f196d571750ce5 (diff)
ocfs2: Clean up the checks for CoW and direct I/O.
When ocfs2 has to do CoW for refcounted extents, we disable direct I/O and go through the buffered I/O path. This makes the combined check easier to read. Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r--fs/ocfs2/file.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index 558ce031242..da097bd07b7 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1836,6 +1836,8 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
&meta_level);
if (has_refcount)
*has_refcount = 1;
+ if (direct_io)
+ *direct_io = 0;
}
if (ret < 0) {
@@ -1859,10 +1861,6 @@ static int ocfs2_prepare_inode_for_write(struct dentry *dentry,
break;
}
- if (has_refcount && *has_refcount == 1) {
- *direct_io = 0;
- break;
- }
/*
* Allowing concurrent direct writes means
* i_size changes wouldn't be synchronized, so