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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jul 15 17:09:12 CDT 2004


Author: mfasheh
Date: 2004-07-15 16:09:10 -0500 (Thu, 15 Jul 2004)
New Revision: 1273

Modified:
   trunk/src/namei.c
Log:
* step two in speeding up delete -- unlink is no longer checkpointed.



Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-07-15 21:03:51 UTC (rev 1272)
+++ trunk/src/namei.c	2004-07-15 21:09:10 UTC (rev 1273)
@@ -683,7 +683,6 @@
 static int ocfs_unlink(struct inode *dir, struct dentry *dentry)
 {
 	int status, tmpstat;
-	int got_parent = 0, got_file = 0;
 	struct inode *inode = dentry->d_inode;
 	int retval = -EBUSY;
 	ocfs_super *osb = OCFS_SB(dir->i_sb);
@@ -721,6 +720,8 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto leave;
 	}
+	ocfs_handle_set_checkpoint(handle, 0);
+	ocfs_handle_set_sync(handle, 0);
 
 	/* lock parent directory, yes we use FLAG_FILE_CREATE even
 	 * though we're deleting ;) */
@@ -731,7 +732,9 @@
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
-	got_parent = 1;
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
+			     FLAG_FILE_CREATE|FLAG_DIR, 
+			     NULL, parentInode, 0);
 
 	/* this will re-read the directory now with the EXCLUSIVE */
 	/* lock already held; it will also return the blkno to us */
@@ -756,13 +759,14 @@
 	}
 
 	status = ocfs_acquire_lock (osb, OCFS_LKM_EXMODE,
-			lockFlags, &fe_bh, inode);
+				    lockFlags, &fe_bh, inode);
 	if (status < 0) {
 		if (status != -EINTR)
 			LOG_ERROR_STATUS (status);
 		goto leave;
 	}
-	got_file = 1;
+	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, lockFlags, fe_bh, 
+			     inode, 0);
 
 	if (S_ISDIR (inode->i_mode)) {
 	       	if (!empty_dir(inode)) {
@@ -853,25 +857,6 @@
 		}
 	}
 
-	/* need this to alert dentry-owners on other nodes */
-	/* Release the file lock if we acquired it */
-	if (got_file) {
-		tmpstat = ocfs_release_lock(osb, OCFS_LKM_EXMODE, 
-					    lockFlags, fe_bh, inode);
-		if (tmpstat < 0)
-			LOG_ERROR_STATUS(tmpstat);
-
-	}
-
-	if (got_parent) {
-		tmpstat = ocfs_release_lock(osb, OCFS_LKM_EXMODE,
-					    FLAG_FILE_CREATE|FLAG_DIR, 
-					    NULL, parentInode);
-		if (tmpstat < 0)
-			LOG_ERROR_STATUS(tmpstat);
-
-	}
-
 	up_write(&OCFS_I(inode)->ip_io_sem);
 	up_write(&OCFS_I(dir)->ip_io_sem);
 bail:



More information about the Ocfs2-commits mailing list