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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Oct 7 17:39:33 CDT 2004


Author: mfasheh
Date: 2004-10-07 17:39:31 -0500 (Thu, 07 Oct 2004)
New Revision: 1556

Modified:
   trunk/src/alloc.c
   trunk/src/dir.c
   trunk/src/file.c
   trunk/src/inode.c
   trunk/src/journal.c
   trunk/src/localalloc.c
   trunk/src/namei.c
   trunk/src/ocfs_journal.h
   trunk/src/suballoc.c
Log:
* make roll-forward the default for transactions.



Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/alloc.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -2069,7 +2069,6 @@
 			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
-		ocfs_handle_set_always_commits(handle, 1);
 	} else {
 		status = ocfs_extend_trans(handle, credits);
 		if (status < 0) {

Modified: trunk/src/dir.c
===================================================================
--- trunk/src/dir.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/dir.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -463,6 +463,7 @@
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto bail;
 	}
+	ocfs_handle_set_may_abort(handle, 1);
 
 	status = ocfs_do_extend_dir(osb->sb, handle, dir, parent_fe_bh, 
 				    data_ac, meta_ac, &new_bh);

Modified: trunk/src/file.c
===================================================================
--- trunk/src/file.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/file.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -448,7 +448,6 @@
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	fe = (ocfs2_dinode *) bh->b_data;
 
@@ -865,7 +864,6 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
 	if (status < 0) {
@@ -946,7 +944,6 @@
 			LOG_ERROR_STATUS (status = -ENOMEM);
 			goto bail;
 		}
-		ocfs_handle_set_always_commits(handle, 1);
 
 		status = ocfs_set_inode_size(handle, inode, fe_bh, new_i_size);
 		if (status < 0)
@@ -1289,6 +1286,7 @@
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto leave;
 	}
+	ocfs_handle_set_may_abort(handle, 1);
 
 restarted_transaction:
 	/* reserve a write to the file entry early on - that we if we

Modified: trunk/src/inode.c
===================================================================
--- trunk/src/inode.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/inode.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -556,7 +556,6 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_set_inode_size(handle, inode, fe_bh, 0ULL);
 	if (status < 0) {
@@ -732,7 +731,6 @@
 		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_orphan_del(osb, handle, orphan_dir_inode, inode, 
 				 orphan_dir_bh);

Modified: trunk/src/journal.c
===================================================================
--- trunk/src/journal.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/journal.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -625,7 +625,7 @@
 
 	handle->k_handle = NULL; /* it's been free'd in journal_stop */
 
-	if (!(handle->flags & OCFS_HANDLE_ALWAYS_COMMITS)) {
+	if (handle->flags & OCFS_HANDLE_MAY_ABORT) {
 		for(i = 0; i < handle->num_buffs; i++) {
 			brelse(handle->buffs[i]);
 			handle->buffs[i] = NULL;
@@ -668,7 +668,7 @@
 	LOG_ENTRY();
 
 	OCFS_ASSERT(handle);
-	OCFS_ASSERT(!(handle->flags & OCFS_HANDLE_ALWAYS_COMMITS));
+	OCFS_ASSERT(handle->flags & OCFS_HANDLE_MAY_ABORT);
 
 	if (!(handle->flags & OCFS_HANDLE_STARTED)) {
 		ocfs_commit_unstarted_handle(handle);
@@ -858,7 +858,7 @@
 
 	if (restarted) {
 		/* only brelse and free copyout buffers if we restarted. */
-		if (!(handle->flags & OCFS_HANDLE_ALWAYS_COMMITS)) {
+		if (handle->flags & OCFS_HANDLE_MAY_ABORT) {
 			for(i = 0; i < handle->num_buffs; i++) {
 				brelse(handle->buffs[i]);
 				handle->buffs[i] = NULL;
@@ -915,7 +915,7 @@
 	}
 
 	/* the copyout junk is only for abort... */
-	if (handle->flags & OCFS_HANDLE_ALWAYS_COMMITS)
+	if (!(handle->flags & OCFS_HANDLE_MAY_ABORT))
 		goto skip_copyout;
 
 	/* search for this buffer in our copyout list. If it's already
@@ -1022,7 +1022,7 @@
 	LOG_ENTRY_ARGS("(bh->b_blocknr=%llu)\n",
 			(unsigned long long)bh->b_blocknr);
 
-	if (handle->flags & OCFS_HANDLE_ALWAYS_COMMITS)
+	if (!(handle->flags & OCFS_HANDLE_MAY_ABORT))
 		goto call_jbd;
 
 	/* First, make sure we aren't already in the list. If we've

Modified: trunk/src/localalloc.c
===================================================================
--- trunk/src/localalloc.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/localalloc.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -288,7 +288,6 @@
 		LOG_ERROR_STATUS(-ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	bh = osb->local_alloc_bh;
 	alloc = (ocfs2_dinode *) bh->b_data;
@@ -457,7 +456,7 @@
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
+
 	/* we want the bitmap change to be recorded on disk asap */
 	ocfs_handle_set_sync(handle, 1);
 
@@ -972,7 +971,6 @@
 		LOG_ERROR_STATUS (status);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
 

Modified: trunk/src/namei.c
===================================================================
--- trunk/src/namei.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/namei.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -372,7 +372,6 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto leave;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	/* do the real work now. */
 	status = ocfs_mknod_locked(osb, dir, dentry, mode, dev,
@@ -704,7 +703,6 @@
 		err = -ENOMEM;
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	err = ocfs_journal_access(handle, fe_bh, OCFS_JOURNAL_ACCESS_WRITE);
 	if (err < 0) {
@@ -854,7 +852,6 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto leave;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_journal_access(handle, fe_bh, OCFS_JOURNAL_ACCESS_WRITE);
 	if (status < 0) {
@@ -1254,7 +1251,6 @@
 		LOG_ERROR_STATUS(status = -ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	if (new_de) {
 		if (S_ISDIR (new_inode->i_mode)) {
@@ -1624,7 +1620,6 @@
 		LOG_ERROR_STATUS (status = -ENOMEM);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_mknod_locked(osb, dir, dentry, 
  				   S_IFLNK | S_IRWXUGO, 0,

Modified: trunk/src/ocfs_journal.h
===================================================================
--- trunk/src/ocfs_journal.h	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/ocfs_journal.h	2004-10-07 22:39:31 UTC (rev 1556)
@@ -213,12 +213,8 @@
 #define OCFS_HANDLE_STARTED			1
 /* should we sync-commit this handle? */
 #define OCFS_HANDLE_SYNC			2
-/* This is really the right way to do things, but until we fix all the
- * code, it's a performance improvement for a handle which never
- * aborts (always roll-forward). Should be set before passing any
- * buffers to journal_access! */
-#define OCFS_HANDLE_ALWAYS_COMMITS		4
-
+/* ocfs_abort_trans is mostly a relic at this point. */
+#define OCFS_HANDLE_MAY_ABORT			4
 static inline int ocfs_handle_started(ocfs_journal_handle *handle)
 {
 	return handle->flags & OCFS_HANDLE_STARTED;
@@ -243,16 +239,15 @@
 		handle->flags &= ~OCFS_HANDLE_SYNC;
 }
 
-static inline void ocfs_handle_set_always_commits(ocfs_journal_handle *handle, 
-						  int always)
+static inline void ocfs_handle_set_may_abort(ocfs_journal_handle *handle, 
+					     int aborts)
 {
-	if (always)
-		handle->flags |= OCFS_HANDLE_ALWAYS_COMMITS;
+	if (aborts)
+		handle->flags |= OCFS_HANDLE_MAY_ABORT;
 	else
-		handle->flags &= ~OCFS_HANDLE_ALWAYS_COMMITS;
+		handle->flags &= ~OCFS_HANDLE_MAY_ABORT;
 }
 
-
 /*
  *  Journal Control:
  *  Initialize, Load, Shutdown, Wipe, Create a journal.

Modified: trunk/src/suballoc.c
===================================================================
--- trunk/src/suballoc.c	2004-10-07 21:46:58 UTC (rev 1555)
+++ trunk/src/suballoc.c	2004-10-07 22:39:31 UTC (rev 1556)
@@ -260,7 +260,6 @@
 		LOG_ERROR_STATUS(status);
 		goto bail;
 	}
-	ocfs_handle_set_always_commits(handle, 1);
 
 	status = ocfs_claim_bits(osb, 
 				 handle, 



More information about the Ocfs2-commits mailing list