diff options
author | Wengang Wang <wen.gang.wang@oracle.com> | 2010-02-09 14:57:45 +0800 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2010-02-16 22:04:15 -0800 |
commit | 1d906125864590674c6f9b7e03a691103956cee7 (patch) | |
tree | 1e6ce4b8bf3f8da7c951cbd1def285a2e2af4d19 /fs | |
parent | f65f548284ca65f53fc94eeaa410e1c47c2bbdfc (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')
-rw-r--r-- | fs/ocfs2/file.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 06ccf6a86d35..c9e4c51f40e3 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 |