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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jul 13 21:16:16 CDT 2004


Author: mfasheh
Date: 2004-07-13 20:16:15 -0500 (Tue, 13 Jul 2004)
New Revision: 1258

Modified:
   trunk/src/alloc.c
Log:
* don't bother loading the local alloc on cluster sizes which we'll be
  ignoring it anyway.



Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-07-14 01:00:27 UTC (rev 1257)
+++ trunk/src/alloc.c	2004-07-14 01:16:15 UTC (rev 1258)
@@ -3960,12 +3960,11 @@
 	/* Ok, now decide if we can use local alloc bitmap.
 	 * We *always* use global bitmap for clustersize > 128k,
 	 * file_size > 2mb, so force it under these conditions. */
-	if ( (handle && osb->have_local_alloc)
-	     && (osb->s_clustersize <= OCFS_LOCAL_ALLOC_MAX_CSIZE)
-	     && (file_size <= OCFS_LOCAL_ALLOC_MAX_ALLOC) )
+	if (handle 
+	    && osb->have_local_alloc
+	    && file_size <= OCFS_LOCAL_ALLOC_MAX_ALLOC) {
 		use_global = 0;
 
-	if (!use_global) {
 		local_alloc_inode = 
 			ocfs_get_system_file_inode(osb, 
 						   LOCAL_ALLOC_SYSTEM_INODE,
@@ -4034,6 +4033,10 @@
 
 	LOG_ENTRY();
 
+	/* we don't enable local alloc on cluster sizes >= 128k */
+	if (osb->s_clustersize > OCFS_LOCAL_ALLOC_MAX_CSIZE)
+		goto bail;
+
 	/* read the alloc off disk */
 	inode = ocfs_get_system_file_inode(osb, LOCAL_ALLOC_SYSTEM_INODE, osb->node_num);
 	if (!inode) {
@@ -4111,7 +4114,7 @@
 	LOG_ENTRY_ARGS("(sync = %s)", sync ? "true" : "false");
 
 	if (!osb->have_local_alloc)
-		return;
+		goto bail;
 
 	bh = osb->local_alloc_bh;
 
@@ -4140,6 +4143,7 @@
 	osb->local_alloc_bh = NULL;
 	osb->have_local_alloc = 0;
 
+bail:
 	LOG_EXIT();
 	return;
 } /* ocfs_shutdown_local_alloc */



More information about the Ocfs2-commits mailing list