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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Fri Sep 10 18:02:41 CDT 2004


Author: mfasheh
Date: 2004-09-10 18:02:39 -0500 (Fri, 10 Sep 2004)
New Revision: 1455

Modified:
   trunk/src/inode.c
   trunk/src/namei.c
Log:
* save us some stack by removing some useless lock flags variables



Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-09-10 22:09:02 UTC (rev 1454)
+++ trunk/src/inode.c	2004-09-10 23:02:39 UTC (rev 1455)
@@ -542,7 +542,6 @@
 	int status = 0;
 	struct buffer_head *orphan_dir_bh = NULL;
 	struct buffer_head *fe_bh = NULL;
-	__u32 lock_flags = FLAG_FILE_DELETE;
 	ocfs2_dinode *fe;
 
 	LOG_SET_CONTEXT(DELETE_INODE);
@@ -588,7 +587,7 @@
 	 * take an extra ref. to avoid recursive calls to
 	 * delete_inode. */
 	atomic_inc(&inode->i_count);
-	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, lock_flags, 
+	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, FLAG_FILE_DELETE, 
 				   &fe_bh, inode);
 	atomic_set(&inode->i_count, 0);
 	if (status < 0) {

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-09-10 22:09:02 UTC (rev 1454)
+++ trunk/src/namei.c	2004-09-10 23:02:39 UTC (rev 1455)
@@ -692,7 +692,6 @@
 	u64 blkno;
 	struct inode *parentInode = dentry->d_parent->d_inode;
 	ocfs2_dinode *fe = NULL;
-	__u32 lockFlags = FLAG_RELEASE_DENTRY;
 	struct buffer_head *fe_bh = NULL;
 	struct buffer_head *parent_node_bh = NULL; /* parent locknode */
 	ocfs_journal_handle *handle = NULL;
@@ -746,13 +745,14 @@
 		BUG();
 
 	status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE,
-				    lockFlags, &fe_bh, inode);
+				    FLAG_RELEASE_DENTRY, &fe_bh, inode);
 	if (status < 0) {
 		if (status != -EINTR)
 			LOG_ERROR_STATUS (status);
 		goto leave;
 	}
-	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, lockFlags, inode);
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, FLAG_RELEASE_DENTRY, 
+			     inode);
 
 	if (S_ISDIR (inode->i_mode)) {
 	       	if (!empty_dir(inode)) {
@@ -989,8 +989,6 @@
 	ocfs_journal_handle *handle = NULL;
 	struct buffer_head *old_dir_bh = NULL;
 	struct buffer_head *new_dir_bh = NULL;
-	__u32 oldfe_flags;
-	__u32 newfe_flags = FLAG_RELEASE_DENTRY;
 	struct ocfs2_dir_entry *old_de = NULL, *new_de = NULL; // dirent for old_dentry 
 							       // and new_dentry
 	struct buffer_head *new_de_bh = NULL, *old_de_bh = NULL; // bhs for above
@@ -1069,10 +1067,9 @@
 		/* Directories actually require metadata updates to
 		 * the directory info so we can't get away with not
 		 * doing node locking on it. */
-		oldfe_flags  = FLAG_RELEASE_DENTRY|FLAG_FILE_RENAME;
-
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
-					   oldfe_flags, &lockbh, old_inode);
+					   FLAG_RELEASE_DENTRY|FLAG_FILE_RENAME, 
+					   &lockbh, old_inode);
 		if (lockbh) {
 			brelse(lockbh);
 			lockbh = NULL;
@@ -1082,7 +1079,8 @@
 			goto finally;
 		}
 
-		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, oldfe_flags, 
+		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
+				     FLAG_RELEASE_DENTRY|FLAG_FILE_RENAME,
 				     old_inode);
 
 		status = -EIO;
@@ -1152,16 +1150,16 @@
 		if (newfe_blkno != OCFS_I(new_inode)->ip_blkno)
 			BUG();
 
-		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
-					   newfe_flags, &newfe_bh, 
+		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 
+					   FLAG_RELEASE_DENTRY, &newfe_bh, 
 					   new_inode);
 		if (status < 0) {
 			LOG_ERROR_STATUS(status);
 			goto finally;
 		}
 
-		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE,
-			newfe_flags, new_inode);
+		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
+				     FLAG_RELEASE_DENTRY, new_inode);
 
 		newfe = (ocfs2_dinode *) newfe_bh->b_data;
 



More information about the Ocfs2-commits mailing list