Skip to content

Commit

Permalink
ocfs2: Clean up the checks for CoW and direct I/O.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wengang Wang authored and Joel Becker committed Feb 26, 2010
1 parent b89c542 commit 96a1cc7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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
Expand Down

0 comments on commit 96a1cc7

Please sign in to comment.