[Ocfs2-commits] mfasheh commits r1520 - branches/dlm-changes/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Sep 29 19:38:47 CDT 2004
Author: mfasheh
Date: 2004-09-29 19:38:46 -0500 (Wed, 29 Sep 2004)
New Revision: 1520
Modified:
branches/dlm-changes/src/alloc.c
Log:
* dirty buffers in ocfs_create_new_meta_bhs
* don't update parent_blk in ocfs_grow_extent_tree past it's last usage.
* fix an off by one in block number calculate in ocfs_grow_extent_tree.
* fix a bug in our extent code where we were running off the end of an
extent block.
Modified: branches/dlm-changes/src/alloc.c
===================================================================
--- branches/dlm-changes/src/alloc.c 2004-09-30 00:33:54 UTC (rev 1519)
+++ branches/dlm-changes/src/alloc.c 2004-09-30 00:38:46 UTC (rev 1520)
@@ -901,6 +901,14 @@
suballoc_bit_start++;
first_blkno++;
+
+ /* We'll also be dirtied by the caller, so
+ * this isn't absolutely necessary. */
+ status = ocfs_journal_dirty(handle, bhs[i]);
+ if (status < 0) {
+ LOG_ERROR_STATUS(status);
+ goto bail;
+ }
}
count += num_got;
@@ -996,7 +1004,7 @@
if (i == 0) {
tmpeb = (ocfs2_extent_block *) bhs[1]->b_data;
ebl->l_recs[fel->l_count].e_blkno =
- tmpeb->h_blkno + 1;
+ tmpeb->h_blkno;
ebl->l_recs[fel->l_count].e_cpos =
fe->i_clusters;
ebl->l_recs[fel->l_count].e_clusters =
@@ -1044,7 +1052,7 @@
eb1->h_parent_blk = parent_blk;
eb1->h_next_leaf_blk = 0;
- parent_blk = last_eb_blkno = eb1->h_blkno;
+ last_eb_blkno = eb1->h_blkno;
for(i = 0; i < numbhs; i++) {
status = ocfs_journal_dirty(handle, bhs[i]);
@@ -1298,13 +1306,6 @@
parent_blk = 0;
for (i = 1; i < fel->l_tree_depth; i++) {
- /* if we loop back around */
- if (eb2) {
- brelse(eb2_bh);
- eb2 = NULL;
- el2 = NULL;
- eb2_bh =NULL;
- }
status = ocfs_read_bh(osb,
parent_blk << osb->sb->s_blocksize_bits,
&eb2_bh,
@@ -1332,8 +1333,12 @@
break;
parent_blk = eb2->h_parent_blk;
+ brelse(eb2_bh);
+ eb2 = NULL;
+ el2 = NULL;
+ eb2_bh = NULL;
} /* for (i = 1; i < fe->i_tree_depth; i++) */
-
+
if (eb2) {
eb2 = NULL;
el2 = NULL;
@@ -1348,6 +1353,7 @@
IncreaseTreeDepth = 1;
goto increase_depth;
}
+
/* ok, we need to add a branch. pass in NULL
* if we need a whole branch, otherwise the
* extent which needs the new leaf */
More information about the Ocfs2-commits
mailing list