[Ocfs2-commits] mfasheh commits r1227 - trunk/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jul 1 20:03:23 CDT 2004


Author: mfasheh
Date: 2004-07-01 19:03:22 -0500 (Thu, 01 Jul 2004)
New Revision: 1227

Modified:
   trunk/src/file.c
   trunk/src/ocfs.h
Log:
* get rid of the OCFS_OIN_OPEN_FOR_WRITE flag.



Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-06-30 01:08:10 UTC (rev 1226)
+++ trunk/src/file.c	2004-07-02 00:03:22 UTC (rev 1227)
@@ -696,7 +696,7 @@
 		size_t count, loff_t *ppos)
 {
 	int ret = 0;
-	int saAcquired = 0, writingAtEOF = 0;
+	int writingAtEOF = 0;
 	ocfs_super *osb = NULL;
 	struct inode *inode = filp->f_dentry->d_inode;
 	int status;
@@ -747,25 +747,6 @@
 	}
 #endif
 
-	if (!(filp->f_flags & O_DIRECT)) {
-		/* FIXME: is the down_sem supposed to be here?! */
-		LOG_TRACE_ARGS ("non O_DIRECT write, fileopencount=%d\n",
-				OCFS_I(inode)->ip_open_cnt);
-		if (OCFS_I(inode)->ip_open_cnt > 1) {
-			if (OCFS_I(inode)->ip_open_flags & OCFS_OIN_OPEN_FOR_WRITE) {
-				LOG_TRACE_STR
-				    ("uh oh! someone else is doing non O_DIRECT writes!\n");
-				ret = -EIO;
-				goto bail;
-			} else {
-				LOG_TRACE_STR
-				    ("there are other readers, but you're the first writer\n");
-				saAcquired = 1;
-				OCFS_SET_FLAG(OCFS_I(inode)->ip_open_flags, OCFS_OIN_OPEN_FOR_WRITE);
-			}
-		}
-	}
-
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		LOG_TRACE_STR ("OIN_NEEDS_VERIFICATION");
 		down_read (&(OCFS_I(inode)->ip_io_sem));
@@ -847,10 +828,6 @@
 	}
 
 bail:
-	if (saAcquired) {
-		OCFS_CLEAR_FLAG(OCFS_I(inode)->ip_open_flags, OCFS_OIN_OPEN_FOR_WRITE);
-	}
-
 	LOG_EXIT_INT (ret);
 
 	LOG_CLEAR_CONTEXT();

Modified: trunk/src/ocfs.h
===================================================================
--- trunk/src/ocfs.h	2004-06-30 01:08:10 UTC (rev 1226)
+++ trunk/src/ocfs.h	2004-07-02 00:03:22 UTC (rev 1227)
@@ -456,7 +456,6 @@
  * merged. */
 /* open flags */
 #define  OCFS_OIN_OPEN_FOR_DIRECTIO              (0x00000008)
-#define  OCFS_OIN_OPEN_FOR_WRITE                 (0x00000010)
 
 /* 'flags' flags. */
 /* has this inode been deleted, either from this node or from another node. */



More information about the Ocfs2-commits mailing list