[Ocfs2-commits] manish commits r1546 - trunk/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Oct 5 15:43:30 CDT 2004
Author: manish
Date: 2004-10-05 15:43:28 -0500 (Tue, 05 Oct 2004)
New Revision: 1546
Modified:
trunk/src/alloc.c
Log:
Move ocfs_free_main_bitmap further up the file so the function body is
available for inlining when it is needed.
Modified: trunk/src/alloc.c
===================================================================
--- trunk/src/alloc.c 2004-10-04 21:18:33 UTC (rev 1545)
+++ trunk/src/alloc.c 2004-10-05 20:43:28 UTC (rev 1546)
@@ -105,12 +105,6 @@
static int ocfs_free_disk_bitmap (ocfs_super * osb, ocfs_free_rec *free_log);
-static inline int ocfs_free_main_bitmap(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *bitmap_inode,
- struct buffer_head *bh,
- ocfs_free_rec *freelog);
-
static int ocfs_extent_contig(struct inode *inode, ocfs2_extent_rec *ext,
u64 blkno);
@@ -231,6 +225,58 @@
return;
}
+static inline int ocfs_free_main_bitmap(ocfs_super *osb,
+ ocfs_journal_handle *handle,
+ struct inode *bitmap_inode,
+ struct buffer_head *bh,
+ ocfs_free_rec *freelog)
+{
+ int i;
+ ocfs_alloc_bm *bitmap;
+ int status;
+ __u32 bitmapblocks; /* we only care about the valid blocks */
+ ocfs2_dinode *bm_lock;
+
+ LOG_ENTRY();
+
+ bitmap = &osb->cluster_bitmap;
+
+ bitmapblocks = ocfs_blocks_for_bits(osb->sb, bitmap->validbits);
+
+ status = ocfs_read_blocks(osb, osb->bitmap_blkno, bitmapblocks,
+ bitmap->chunk, OCFS_BH_CACHED, bitmap_inode);
+ if (status < 0) {
+ LOG_ERROR_STATUS(status);
+ goto bail;
+ }
+
+ status = ocfs_journal_access(handle, bh,
+ OCFS_JOURNAL_ACCESS_WRITE);
+ if (status < 0) {
+ LOG_ERROR_STATUS(status);
+ goto bail;
+ }
+ bm_lock = (ocfs2_dinode *) bh->b_data;
+
+ for (i = 0; i < freelog->num_updates; i++) {
+ ocfs_clear_bits(osb->sb, handle, bitmap,
+ freelog->update[i].file_off,
+ freelog->update[i].length);
+ bm_lock->id1.bitmap1.i_used -= freelog->update[i].length;
+ }
+
+ status = ocfs_journal_dirty(handle, bh);
+ if (status < 0) {
+ LOG_ERROR_STATUS (status);
+ goto bail;
+ }
+
+ status = 0;
+bail:
+ LOG_EXIT_STATUS(status);
+ return(0);
+}
+
/*
* ocfs_free_disk_bitmap()
*
@@ -409,58 +455,6 @@
return status;
} /* ocfs_free_disk_bitmap */
-static inline int ocfs_free_main_bitmap(ocfs_super *osb,
- ocfs_journal_handle *handle,
- struct inode *bitmap_inode,
- struct buffer_head *bh,
- ocfs_free_rec *freelog)
-{
- int i;
- ocfs_alloc_bm *bitmap;
- int status;
- __u32 bitmapblocks; /* we only care about the valid blocks */
- ocfs2_dinode *bm_lock;
-
- LOG_ENTRY();
-
- bitmap = &osb->cluster_bitmap;
-
- bitmapblocks = ocfs_blocks_for_bits(osb->sb, bitmap->validbits);
-
- status = ocfs_read_blocks(osb, osb->bitmap_blkno, bitmapblocks,
- bitmap->chunk, OCFS_BH_CACHED, bitmap_inode);
- if (status < 0) {
- LOG_ERROR_STATUS(status);
- goto bail;
- }
-
- status = ocfs_journal_access(handle, bh,
- OCFS_JOURNAL_ACCESS_WRITE);
- if (status < 0) {
- LOG_ERROR_STATUS(status);
- goto bail;
- }
- bm_lock = (ocfs2_dinode *) bh->b_data;
-
- for (i = 0; i < freelog->num_updates; i++) {
- ocfs_clear_bits(osb->sb, handle, bitmap,
- freelog->update[i].file_off,
- freelog->update[i].length);
- bm_lock->id1.bitmap1.i_used -= freelog->update[i].length;
- }
-
- status = ocfs_journal_dirty(handle, bh);
- if (status < 0) {
- LOG_ERROR_STATUS (status);
- goto bail;
- }
-
- status = 0;
-bail:
- LOG_EXIT_STATUS(status);
- return(0);
-}
-
/*
* How many free extents have we got before we need more meta data?
*/
More information about the Ocfs2-commits
mailing list