[Ocfs2-commits] mfasheh commits r2103 - trunk/fs/ocfs2

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Sat Apr 2 00:16:52 CST 2005


Author: mfasheh
Signed-off-by: manish
Date: 2005-04-02 00:16:51 -0600 (Sat, 02 Apr 2005)
New Revision: 2103

Modified:
   trunk/fs/ocfs2/file.c
Log:
* some fixes to the open path to allow buffered readers when a file is
  open o_direct.

Signed-off-by: manish



Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c	2005-04-02 06:06:41 UTC (rev 2102)
+++ trunk/fs/ocfs2/file.c	2005-04-02 06:16:51 UTC (rev 2103)
@@ -75,12 +75,15 @@
 static inline int ocfs2_valid_open(int mode, int open_direct)
 {
 	int ret = 1;
+	int writing;
 
+	writing = (mode & O_RDWR) || (mode & O_WRONLY);
+
 	if (mode & O_DIRECT) {
 		if (!open_direct)
 			ret = 0;
 	} else {
-		if (open_direct && !(mode & O_RDONLY))
+		if (open_direct && writing)
 			ret = 0;
 	}
 	return ret;
@@ -112,8 +115,6 @@
 
 	if (mode & O_DIRECT)
 		oip->ip_flags |= OCFS_INODE_OPEN_DIRECT;
-	else
-		oip->ip_flags &= ~OCFS_INODE_OPEN_DIRECT;
 
 	oip->ip_open_cnt++;
 	spin_unlock(&oip->ip_lock);



More information about the Ocfs2-commits mailing list