[Ocfs2-commits] mfasheh commits r1511 - branches/dlm-changes/src

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Wed Sep 29 18:00:51 CDT 2004


Author: mfasheh
Date: 2004-09-29 18:00:50 -0500 (Wed, 29 Sep 2004)
New Revision: 1511

Modified:
   branches/dlm-changes/src/journal.c
Log:
* clean up the add_inode code as we don't need to handle that case
  anymore.

* use list_del_init.



Modified: branches/dlm-changes/src/journal.c
===================================================================
--- branches/dlm-changes/src/journal.c	2004-09-29 21:30:33 UTC (rev 1510)
+++ branches/dlm-changes/src/journal.c	2004-09-29 23:00:50 UTC (rev 1511)
@@ -494,32 +494,14 @@
 	OCFS_ASSERT(handle);
 	OCFS_ASSERT(inode);
 
-	if (OCFS_I(inode)->ip_handle == handle) {
-		/* sanity check */
-		if (list_empty(&OCFS_I(inode)->ip_handle_list))
-			BUG();
-
-		/* I think this can happen to the main bitmap inode if
-		 * we extend a regular file and also have to extend a
-		 * system file in the same transaction */
-		LOG_TRACE_ARGS("Inode %lu already added to transaction!\n",
-			       inode->i_ino);
-
-		/* lets not allow recursive locking for regular
-		 * files. it sucks enough that we have to do it for
-		 * system files. */
-		OCFS_ASSERT(OCFS_I(inode)->ip_flags & OCFS_INODE_SYSTEM_FILE);
-		return;
-	}
-
 	atomic_inc(&inode->i_count);
 
 	/* we're obviously changing it... */
 	down_write(&OCFS_I(inode)->ip_io_sem);
 
 	/* sanity check */
-	if (OCFS_I(inode)->ip_handle)
-		BUG();
+	OCFS_ASSERT(!OCFS_I(inode)->ip_handle);
+	OCFS_ASSERT(list_empty(&OCFS_I(inode)->ip_handle_list));
 
 	OCFS_I(inode)->ip_handle = handle;
 	list_del(&(OCFS_I(inode)->ip_handle_list));
@@ -539,8 +521,7 @@
 		inode = ip->ip_inode;
 
 		OCFS_I(inode)->ip_handle = NULL;
-		list_del(&OCFS_I(inode)->ip_handle_list);
-		INIT_LIST_HEAD(&OCFS_I(inode)->ip_handle_list);
+		list_del_init(&OCFS_I(inode)->ip_handle_list);
 
 		up_write(&OCFS_I(inode)->ip_io_sem);
 		iput(inode);



More information about the Ocfs2-commits mailing list