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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 8 20:14:42 CDT 2004


Author: mfasheh
Date: 2004-09-08 20:14:40 -0500 (Wed, 08 Sep 2004)
New Revision: 1439

Modified:
   trunk/src/aops.c
   trunk/src/dlm.c
   trunk/src/file.c
   trunk/src/inode.c
   trunk/src/inode.h
   trunk/src/lockres.c
   trunk/src/lockres.h
   trunk/src/namei.c
   trunk/src/nm.c
Log:
* verify_update_inode always took '0' for it's lockres_locked argument, so
  just remove that. If we do the locking in verify_update_inode ourselves,
  then we pass '1' to ocfs_update_lockres and there's no callers left that
  pass '0' except for mknod and symlink which should've been passing '1' 
  for performance reasons anyway. So just remove that argument and the 
  now useless 'timeout' argument from it. Yay, stack savings.



Modified: trunk/src/aops.c
===================================================================
--- trunk/src/aops.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/aops.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -520,7 +520,7 @@
 	/* make sure we're up to date... */
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		LOG_TRACE_STR ("ocfs_direct_IO_get_blocks: verify oin.");
-		status = ocfs_verify_update_inode (osb, inode, 0);
+		status = ocfs_verify_update_inode (osb, inode);
 		if (status < 0) {
 			LOG_TRACE_STR ("ocfs_verify_update_inode failed");
 			ret = -EIO;

Modified: trunk/src/dlm.c
===================================================================
--- trunk/src/dlm.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/dlm.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -228,7 +228,7 @@
 	LOG_TRACE_ARGS("attempting to get lock, pass: %d\n", ++k);
 
 	if (!updated) {
-		status = ocfs_update_lockres(osb, *bh, 0, inode, 1, 1);
+		status = ocfs_update_lockres(osb, *bh, inode, 1);
 		if (status < 0) {
 			ocfs_release_lockres (lockres);
 			LOG_ERROR_STATUS (status);

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/file.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -143,7 +143,7 @@
 
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		down_read (&(OCFS_I(inode)->ip_io_sem));
-		status = ocfs_verify_update_inode (osb, inode, 0);
+		status = ocfs_verify_update_inode (osb, inode);
 		up_read (&(OCFS_I(inode)->ip_io_sem));
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
@@ -616,7 +616,7 @@
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		LOG_TRACE_STR ("OIN_NEEDS_VERIFICATION");
 		down_read (&(OCFS_I(inode)->ip_io_sem));
-		status = ocfs_verify_update_inode (osb, inode, 0);
+		status = ocfs_verify_update_inode (osb, inode);
 		up_read (&(OCFS_I(inode)->ip_io_sem));
 		if (status < 0) {
 			LOG_TRACE_STR ("ocfs_verify_update_inode failed");
@@ -762,7 +762,7 @@
 	}
 	if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 		down_read(&OCFS_I(inode)->ip_io_sem);
-		status = ocfs_verify_update_inode (osb, inode, 0);
+		status = ocfs_verify_update_inode (osb, inode);
 		up_read(&OCFS_I(inode)->ip_io_sem);
 		if (status < 0) {
 			LOG_TRACE_STR ("ocfs_verify_update_inode failed");
@@ -1338,7 +1338,7 @@
 	if (attr->ia_valid & ATTR_SIZE) {
 		if (atomic_read(&OCFS_I(inode)->ip_needs_verification)) {
 			LOG_TRACE_STR ("OIN_NEEDS_VERIFICATION");
-			status = ocfs_verify_update_inode (osb, inode, 0);
+			status = ocfs_verify_update_inode (osb, inode);
 			if (status < 0) {
 				LOG_ERROR_STATUS (status);
 				LOG_TRACE_STR ("TODO: disable volume");

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/inode.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -506,7 +506,7 @@
 		OCFS_SET_FLAG(OCFS_I(inode)->ip_flags, OCFS_INODE_SYSTEM_FILE);
 
 	ocfs_init_lockres (osb, inode);
-	status = ocfs_update_lockres(osb, bh, 0, inode, 0, 1);
+	status = ocfs_update_lockres(osb, bh, inode, 0);
 	if (status < 0) {
 		make_bad_inode(inode);
 		goto bail;
@@ -920,7 +920,7 @@
 	ocfs_release_lockres(GET_INODE_LOCKRES(inode));
 
 	atomic_set(&OCFS_I(inode)->ip_needs_verification, 1);
-	status = ocfs_verify_update_inode(osb, inode, 0);
+	status = ocfs_verify_update_inode(osb, inode);
 	if (status < 0) {
 		LOG_ERROR_STATUS (status);
 		status = -ENOENT;
@@ -1062,11 +1062,12 @@
 /*
  * ocfs_verify_update_inode()
  */ 
-int ocfs_verify_update_inode (ocfs_super * osb, struct inode * inode, int lockres_locked)
+int ocfs_verify_update_inode (ocfs_super * osb, struct inode * inode)
 {
 	int status = 0;
 	struct buffer_head *fe_bh = NULL;
 	ocfs2_dinode *fe;
+	ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
 
 	/* We are setting the oin Updated flag in the end. */
 	LOG_ENTRY ();
@@ -1105,8 +1106,9 @@
 		goto leave;
 	}
 
-	status = ocfs_update_lockres (osb, fe_bh, 0, inode, 0, 
-				      lockres_locked);
+	ocfs_acquire_lockres(lockres, 0);
+	status = ocfs_update_lockres (osb, fe_bh, inode, 0);
+	ocfs_release_lockres(lockres);
 
 	status = 0;
 leave:

Modified: trunk/src/inode.h
===================================================================
--- trunk/src/inode.h	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/inode.h	2004-09-09 01:14:40 UTC (rev 1439)
@@ -45,8 +45,7 @@
 ssize_t ocfs_rw_direct(int rw, struct file *filp, char *buf,
 		       size_t size, loff_t *offp);
 void ocfs_sync_blockdev(struct super_block *sb);
-int ocfs_verify_update_inode(ocfs_super *osb, struct inode *inode, 
-			     int lockres_locked);
+int ocfs_verify_update_inode(ocfs_super *osb, struct inode *inode);
 int ocfs_refresh_inode(struct inode *inode, 
 				ocfs2_dinode *fe);
 #ifdef AIO_ENABLED

Modified: trunk/src/lockres.c
===================================================================
--- trunk/src/lockres.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/lockres.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -58,14 +58,13 @@
  * Returns 0 if success, < 0 if error.
  */
 int ocfs_update_lockres(ocfs_super *osb, struct buffer_head *bh,
-			__u32 timeout, struct inode *inode, int reread, 
-			int locked)
+			struct inode *inode, int reread)
 {
 	int status = 0;
 	ocfs2_dinode *fe;
 	int flags;
 	int drop_bh = 0;
-	ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);;
+	ocfs_lock_res *lockres = GET_INODE_LOCKRES(inode);
 
 	LOG_ENTRY_ARGS("(0x%p, %llu, 0x%p, 0x%p)\n", osb,
 		       OCFS_I(inode)->ip_blkno << inode->i_sb->s_blocksize_bits,
@@ -78,18 +77,10 @@
 	if (!bh) 
 		drop_bh = 1;
 
-	if (!locked)
-		status = ocfs_acquire_lockres (lockres, timeout);
-	if (status < 0) {
-		LOG_TRACE_ARGS ("Timedout locking lockres for inode: %llu\n",
-				OCFS_I(inode)->ip_blkno);
-		goto out;
-	}
-
 	/* Behavior for process_vote: if you don't pass a buffer, then
 	 * we'll only read if you're not he master. */
 	if ((bh == NULL) && (lockres->master_node_num == osb->node_num))
-		goto out_unlock;
+		goto out;
 
 	if (reread) {
 		flags = lockres->master_node_num == osb->node_num ? 
@@ -99,7 +90,7 @@
 				      &bh, flags, inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS (status);
-			goto out_unlock;
+			goto out;
 		}
 	}
 
@@ -118,16 +109,7 @@
 		lockres->readonly_node = OCFS_INVALID_NODE_NUM;
 	}
 
-out_unlock:
-	if (!locked)
-		ocfs_release_lockres (lockres);
-
 out:
-	if (status < 0) {
-		if (status != -ETIMEDOUT)
-			LOG_ERROR_STATUS (status);
-	}
-
 	if (bh && drop_bh)
 		brelse(bh);
 

Modified: trunk/src/lockres.h
===================================================================
--- trunk/src/lockres.h	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/lockres.h	2004-09-09 01:14:40 UTC (rev 1439)
@@ -34,7 +34,6 @@
 void ocfs_init_lockres(ocfs_super *osb, struct inode *inode);
 void ocfs_release_lockres(ocfs_lock_res *lockres);
 int ocfs_update_lockres(ocfs_super *osb, struct buffer_head *bh, 
-			__u32 timeout, struct inode *inode, 
-			int reread, int locked);
+			struct inode *inode, int reread);
 
 #endif /* OCFS2_LOCKRES_H */

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/namei.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -286,7 +286,7 @@
 
 	ocfs_init_lockres(osb, inode);
 
-	status = ocfs_update_lockres(osb, new_fe_bh, 0, inode, 0, 0);
+	status = ocfs_update_lockres(osb, new_fe_bh, inode, 0);
 	if (S_ISDIR (mode)) {
 		struct buffer_head *newdirbh = NULL;
 		int retval = 0;
@@ -1571,7 +1571,7 @@
 
 	ocfs_inode_set_new(osb, inode);
 	ocfs_init_lockres(osb, inode);
-	status = ocfs_update_lockres(osb, new_fe_bh, 0, inode, 0, 0);
+	status = ocfs_update_lockres(osb, new_fe_bh, inode, 0);
 	if (status < 0)
 		LOG_ERROR_STATUS(status);
 

Modified: trunk/src/nm.c
===================================================================
--- trunk/src/nm.c	2004-09-09 00:32:27 UTC (rev 1438)
+++ trunk/src/nm.c	2004-09-09 01:14:40 UTC (rev 1439)
@@ -710,9 +710,7 @@
 
 		/* since we pass a NULL bh, this'll only do a read if
 		 * we're not the master. */
-		status = ocfs_update_lockres (osb, NULL, 
-					      (OCFS_NM_HEARTBEAT_TIME/2), 
-					      inode, 1, 1);
+		status = ocfs_update_lockres (osb, NULL, inode, 1);
 		if (status < 0) {
 			if (status != -ETIMEDOUT)
 				LOG_ERROR_STATUS (status);
@@ -1076,7 +1074,7 @@
 		down_read(&OCFS_I(inode)->ip_io_sem);
 #endif
 		if (have_io_sem) {
-			tmpstat = ocfs_verify_update_inode(osb, inode, 0);
+			tmpstat = ocfs_verify_update_inode(osb, inode);
 			if (tmpstat < 0)
 				LOG_ERROR_STATUS(tmpstat);
 			up_read(&OCFS_I(inode)->ip_io_sem);



More information about the Ocfs2-commits mailing list