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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Jun 16 21:17:47 CDT 2004


Author: mfasheh
Date: 2004-06-16 20:17:45 -0500 (Wed, 16 Jun 2004)
New Revision: 1121

Modified:
   trunk/src/inode.c
   trunk/src/namei.c
Log:
* order the inode hash inserts some more.
* Remove some useless locking.



Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-06-17 00:46:54 UTC (rev 1120)
+++ trunk/src/inode.c	2004-06-17 01:17:45 UTC (rev 1121)
@@ -716,15 +716,10 @@
 			     FLAG_FILE_CREATE | FLAG_DIR, orphan_dir_bh,
 			     orphan_dir_inode, 1);
 
-	/* take ip_io_sem on the inode, only to avoid a warning in
-	 * acquire_lockres. We can get rid of it when we get rid of
-	 * acquire_lockres */
-	down_write(&OCFS_I(inode)->ip_io_sem);
 	if (S_ISDIR(inode->i_mode))
 		lock_flags |= FLAG_DIR;
 	status = ocfs_acquire_lock(osb, OCFS_DLM_EXCLUSIVE_LOCK, lock_flags, 
 				   &fe_bh, inode);
-	up_write(&OCFS_I(inode)->ip_io_sem);
 	if (status < 0) {
 		/* EBUSY here is assumed to mean that other nodes are
 		 * still using the inode. We're done here though, so
@@ -790,10 +785,8 @@
 		ocfs_abort_trans(handle);
 
 	if (release_disk_lock) {
-		down_write(&OCFS_I(inode)->ip_io_sem);
 		status = ocfs_release_lock(osb, OCFS_DLM_EXCLUSIVE_LOCK, 
 					   lock_flags, fe_bh, inode);
-		up_write(&OCFS_I(inode)->ip_io_sem);
 		if (status < 0)
 			LOG_ERROR_STATUS(status);
 	}

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-06-17 00:46:54 UTC (rev 1120)
+++ trunk/src/namei.c	2004-06-17 01:17:45 UTC (rev 1121)
@@ -210,7 +210,6 @@
 	fe = OCFS_BH_GET_DATA_READ(new_fe_bh);
 
 	ocfs_populate_inode (inode, fe, mode, 1);
-	insert_inode_hash (inode);
 
 	file_off = fe->this_sector;
 	handle->new_file_lockid = fe->this_sector;
@@ -219,7 +218,6 @@
 
 	ocfs_init_lockres (osb, inode);
 
-	ocfs_handle_add_inode(handle, inode);
 	status = ocfs_update_lockres (osb, GET_INODE_FEOFF(inode), 
 				      &new_fe_bh, NULL, 0, inode, 0, 0);
 	if (S_ISDIR (mode)) {
@@ -277,6 +275,7 @@
 		dir->i_nlink++;
 	}
 
+	insert_inode_hash (inode);
 	d_instantiate (dentry, inode);
 	ocfs_commit_trans(handle);
 
@@ -1330,6 +1329,9 @@
 	if (status < 0) {
 		ocfs_abort_trans(handle);
 	} else {
+		insert_inode_hash (inode);
+		d_instantiate (dentry, inode);
+
 		ocfs_commit_trans(handle);
 		status = ocfs_block_symlink (inode, symname, l);
 		if (status < 0)
@@ -1348,12 +1350,6 @@
 bail:
 	up_write(&OCFS_I(dir)->ip_io_sem);
 
-	/* can we race with the nm threads iget() here? */
-	if (status >= 0) {
-		insert_inode_hash (inode);
-		d_instantiate (dentry, inode);
-	}
-
 	if (new_fe_bh) {
 		if (fe)
 			OCFS_BH_PUT_DATA(new_fe_bh);



More information about the Ocfs2-commits mailing list