From: Wengang Wang Date: Tue, 9 Feb 2010 06:57:45 +0000 (+0800) Subject: ocfs2: Clean up the checks for CoW and direct I/O. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=96a1cc731adb28dc4feb71701091b80e67d486a7;p=linux-beck.git 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 Signed-off-by: Joel Becker --- diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 558ce0312421..da097bd07b72 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