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

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jul 13 20:28:22 CDT 2004


Author: mfasheh
Date: 2004-07-13 19:28:21 -0500 (Tue, 13 Jul 2004)
New Revision: 1256

Modified:
   trunk/src/alloc.c
Log:
* Just get rid of all the local alloc abort stuff. There's no downside
  to keeping it around anyway, even in ENOSPC situations as it's been
  synced up to the main bitmap. This reverts my last change, but it
  uncomplicates the code, and fixes the same bug without introducing
  another one.



Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c	2004-07-14 00:03:19 UTC (rev 1255)
+++ trunk/src/alloc.c	2004-07-14 00:28:21 UTC (rev 1256)
@@ -118,9 +118,6 @@
 static int ocfs_local_find_clear_bits(ocfs_super *osb,
 				      ocfs2_dinode *alloc,
 				      __u32 numbits);
-static int ocfs_abort_local_alloc(ocfs_super *osb, 
-				  ocfs_journal_handle *handle, 
-				  struct inode *main_bm_inode);
 static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
 			      u64 blkno);
 
@@ -3788,77 +3785,6 @@
 	return(bitoff);
 } /* ocfs_local_find_clear_bits */
 
-/* we hit some error on the local alloc and need to disable it. 
- * If you pass me the bitmap inode, I'll assume it's all locked for us. 
- */
-static int ocfs_abort_local_alloc(ocfs_super *osb, 
-				  ocfs_journal_handle *handle, 
-				  struct inode *main_bm_inode)
-{
-	int status = 0;
-	struct buffer_head *main_bm_bh = NULL;
-	ocfs2_dinode *alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
-
-	if (main_bm_inode) {
-		if (!igrab(main_bm_inode))
-			BUG();
-	} else {
-		main_bm_inode = ocfs_get_system_file_inode(osb, GLOBAL_BITMAP_SYSTEM_INODE, -1);
-		if (!main_bm_inode) {
-			status = -EINVAL;
-			LOG_ERROR_STATUS (status);
-			goto bail;
-		}
-
-		ocfs_handle_add_inode(handle, main_bm_inode);
-
-		status = ocfs_acquire_lock(osb, OCFS_LKM_EXMODE, 
-					   0, &main_bm_bh, main_bm_inode);
-		if (status < 0) {
-			main_bm_bh = NULL;
-			if (status != -EINTR)
-				LOG_ERROR_STATUS (status);
-			goto bail;
-		}
-
-		ocfs_handle_add_lock(handle, OCFS_LKM_EXMODE, 
-				     0, main_bm_bh, main_bm_inode, 1);
-	}
-
-	status = ocfs_journal_access(handle, osb->local_alloc_bh, 
-				     OCFS_JOURNAL_ACCESS_WRITE);
-	if (status < 0) {
-		LOG_ERROR_STATUS(status);
-		goto bail;
-	}
-
-	status = ocfs_sync_local_to_main(osb, handle, alloc, main_bm_inode);
-	if (status < 0) {
-		LOG_ERROR_STATUS(status);
-		goto bail;
-	}
-
-	ocfs_clear_local_alloc(alloc);
-
-	status = ocfs_journal_dirty(handle, osb->local_alloc_bh);
-	if (status < 0) {
-		LOG_ERROR_STATUS(status);
-		goto bail;
-	}
-
-	osb->have_local_alloc = 0;
-	brelse(osb->local_alloc_bh);
-	osb->local_alloc_bh = NULL;
-bail:
-	if (main_bm_inode)
-		iput(main_bm_inode);
-
-	if (main_bm_bh)
-		brelse(main_bm_bh);
-
-	return(status);
-}
-
 /*
  * ocfs_find_space_from_local
  */
@@ -3904,23 +3830,15 @@
 		status = ocfs_alloc_new_window(osb, main_bm_bh, main_bm_inode, 
 					       handle);
 		if (status < 0) {
-			if (status == -ENOSPC) {
-				printk("ocfs2: disabling local alloc "
-				       "bitmap for this mount.\n");
+			if (status != -ENOSPC)
+				LOG_ERROR_STATUS(status);
 
-#warning what if we abort_trans after this call?
-				tmpstat = ocfs_abort_local_alloc(osb, 
-								 handle, 
-								 main_bm_inode);
-				if (tmpstat < 0) {
-					LOG_ERROR_STATUS(tmpstat);
-					status = tmpstat;
-				}
+			/* it may not have been dirtied yet... */
+			tmpstat = ocfs_journal_dirty(handle, 
+						     osb->local_alloc_bh);
+			if (tmpstat < 0)
+				LOG_ERROR_STATUS(tmpstat);
 
-				alloc = NULL;
-				goto bail;
-			}
-			LOG_ERROR_STATUS(status);
 			goto bail;
 		}
 		atomic_inc(&osb->alloc_stats.moves);



More information about the Ocfs2-commits mailing list