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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Mon Sep 13 20:39:46 CDT 2004


Author: mfasheh
Date: 2004-09-13 20:39:44 -0500 (Mon, 13 Sep 2004)
New Revision: 1474

Modified:
   branches/dlm-changes/src/alloc.c
   branches/dlm-changes/src/inode.c
   branches/dlm-changes/src/namei.c
   branches/dlm-changes/src/ocfs_journal.h
Log:
* move the io_sem stuff for system files too.



Modified: branches/dlm-changes/src/alloc.c
===================================================================
--- branches/dlm-changes/src/alloc.c	2004-09-14 00:28:13 UTC (rev 1473)
+++ branches/dlm-changes/src/alloc.c	2004-09-14 01:39:44 UTC (rev 1474)
@@ -356,7 +356,6 @@
 				LOG_ERROR_STATUS (status);
 				goto abort;
 			}
-			ocfs_handle_add_inode(handle, inode_alloc_inode[i]);
 
 			status = ocfs_acquire_lock (osb, 
 						    OCFS_LKM_EXMODE,
@@ -377,6 +376,7 @@
 			ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
 					     0, 
 					     inode_alloc_inode[i]);
+			ocfs_handle_add_inode(handle, inode_alloc_inode[i]);
 		}
 	}
 
@@ -389,7 +389,6 @@
 				LOG_ERROR_STATUS (status);
 				goto abort;
 			}
-			ocfs_handle_add_inode(handle, ext_alloc_inode[i]);
 
 			status = ocfs_acquire_lock (osb, 
 						    OCFS_LKM_EXMODE,
@@ -410,6 +409,7 @@
 			ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
 					     0,  
 					     ext_alloc_inode[i]);
+			ocfs_handle_add_inode(handle, ext_alloc_inode[i]);
 		}
 	}
 
@@ -420,7 +420,6 @@
 			LOG_ERROR_STATUS (status);
 			goto abort;
 		}
-		ocfs_handle_add_inode(handle, vol_inode);
 
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE,
 					   0,
@@ -435,6 +434,7 @@
 		}
 		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
 				     0, vol_inode);
+		ocfs_handle_add_inode(handle, vol_inode);
 	}
 
 	/* free vol block */
@@ -2922,8 +2922,6 @@
 	} else { /* local lock */
 		local_lock = 1;
 
-		ocfs_handle_add_inode(handle, bitmap_inode);
-
 		/* Get the allocation lock here */
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 
 					   0, &bh, bitmap_inode);
@@ -2934,6 +2932,7 @@
 		}
 		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
 				      0, bitmap_inode);
+		ocfs_handle_add_inode(handle, bitmap_inode);
 	}
 
 	status = ocfs_journal_access(handle, bh, OCFS_JOURNAL_ACCESS_WRITE);
@@ -3714,6 +3713,12 @@
 
 	LOG_ENTRY_ARGS("(numbits wanted = %u)\n", numbits);
 
+	if (LOCAL_ALLOC(alloc)->la_bm_bits == 0) {
+		LOG_TRACE_STR("No bits in my window!");
+		bitoff = -1;
+		goto bail;
+	}
+
 	bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
 
 	numfound = bitoff = startoff = 0;
@@ -3753,6 +3758,7 @@
 	else
 		bitoff = -1;
 
+bail:
 	LOG_EXIT_STATUS(bitoff);
 	return(bitoff);
 } /* ocfs_local_find_clear_bits */
@@ -3834,9 +3840,6 @@
 			goto bail;
 		}
 
-		/* lock bitmap here */
-		ocfs_handle_add_inode(handle, main_bm_inode);
-
 		/* Get the allocation lock here */
 		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 
 					   0, &main_bm_bh, main_bm_inode);
@@ -3846,9 +3849,9 @@
 				LOG_ERROR_STATUS (status);
 			goto bail;
 		}
-
 		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
 				     0, main_bm_inode);
+		ocfs_handle_add_inode(handle, main_bm_inode);
 
 		status = ocfs_sync_local_to_main(osb, handle, alloc,
 						 main_bm_inode);

Modified: branches/dlm-changes/src/inode.c
===================================================================
--- branches/dlm-changes/src/inode.c	2004-09-14 00:28:13 UTC (rev 1473)
+++ branches/dlm-changes/src/inode.c	2004-09-14 01:39:44 UTC (rev 1474)
@@ -629,8 +629,6 @@
 		goto clear_inode;
 	}
 
-	ocfs_handle_add_inode(handle, orphan_dir_inode);
-
 	lock_kernel();
 
 	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0,
@@ -641,6 +639,7 @@
 	}
 	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0,
 			     orphan_dir_inode);
+	ocfs_handle_add_inode(handle, orphan_dir_inode);
 
 	status = ocfs_orphan_del(osb, handle, orphan_dir_inode, inode, 
 				 orphan_dir_bh);

Modified: branches/dlm-changes/src/namei.c
===================================================================
--- branches/dlm-changes/src/namei.c	2004-09-14 00:28:13 UTC (rev 1473)
+++ branches/dlm-changes/src/namei.c	2004-09-14 01:39:44 UTC (rev 1474)
@@ -1930,7 +1930,6 @@
 		LOG_ERROR_STATUS(status);
 		goto leave;
 	}
-	ocfs_handle_add_inode(handle, orphan_dir_inode);
 
 	/* disk lock orphan dir here. */
 	status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 0,
@@ -1941,6 +1940,7 @@
 	}
 	ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 0, 
 			     orphan_dir_inode);
+	ocfs_handle_add_inode(handle, orphan_dir_inode);
 
 	status = __ocfs_add_entry(handle, orphan_dir_inode, name, namelen, 
 				  inode, OCFS_I(inode)->ip_blkno, 

Modified: branches/dlm-changes/src/ocfs_journal.h
===================================================================
--- branches/dlm-changes/src/ocfs_journal.h	2004-09-14 00:28:13 UTC (rev 1473)
+++ branches/dlm-changes/src/ocfs_journal.h	2004-09-14 01:39:44 UTC (rev 1474)
@@ -395,6 +395,9 @@
 			    (OCFS_SINGLE_FILE_EXTEND_CREDITS * 4) +	      \
 			    OCFS_JOURNAL_FUZZ_CREDITS)
 
+/* local alloc metadata change + main bitmap updates */
+#define OCFS_WINDOW_MOVE_CREDIT (1 + 8)
+
 /* single file metadata updates * 3 because we might have to extend
  * the file alloc and file alloc bitmap files + possible update to
  * local bitmap. + 2 blocks for bits to set in the metadata alloc



More information about the Ocfs2-commits mailing list