[Ocfs2-commits] mfasheh commits r1634 - branches/cluster-groups/src
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Wed Nov 10 14:45:22 CST 2004
Author: mfasheh
Date: 2004-11-10 14:45:20 -0600 (Wed, 10 Nov 2004)
New Revision: 1634
Modified:
branches/cluster-groups/src/localalloc.c
branches/cluster-groups/src/suballoc.c
Log:
* fixes to silence -ENOSPC errors
* turn debug printks into LOG_TRACE_*
* remove some useless 'return;' lines
Modified: branches/cluster-groups/src/localalloc.c
===================================================================
--- branches/cluster-groups/src/localalloc.c 2004-11-10 20:43:19 UTC (rev 1633)
+++ branches/cluster-groups/src/localalloc.c 2004-11-10 20:45:20 UTC (rev 1634)
@@ -778,11 +778,6 @@
goto bail;
}
- printk("sync_local_to_main: alloc->la_bm_bits = %u, COUNT = %u, "
- "la_bits_set = %u\n", LOCAL_ALLOC(alloc)->la_bm_bits,
- ocfs_local_alloc_count_bits(alloc),
- LOCAL_ALLOC(alloc)->la_bits_set);
-
la_start_blk = ocfs2_clusters_to_blocks(osb->sb,
LOCAL_ALLOC(alloc)->la_bm_off);
bitmap = LOCAL_ALLOC(alloc)->la_bitmap;
@@ -803,10 +798,10 @@
ocfs2_clusters_to_blocks(osb->sb,
start - count);
- printk("sync_local_to_main: freeing %u bits starting "
- "at local alloc bit %u (la_start_blk = %llu, "
- "blkno = %llu)\n", count, start - count,
- la_start_blk, blkno);
+ LOG_TRACE_ARGS("freeing %u bits starting at local "
+ "alloc bit %u (la_start_blk = %llu, "
+ "blkno = %llu)\n", count, start - count,
+ la_start_blk, blkno);
status = ocfs_free_clusters(handle, main_bm_inode,
main_bm_bh, blkno, count);
Modified: branches/cluster-groups/src/suballoc.c
===================================================================
--- branches/cluster-groups/src/suballoc.c 2004-11-10 20:43:19 UTC (rev 1633)
+++ branches/cluster-groups/src/suballoc.c 2004-11-10 20:45:20 UTC (rev 1634)
@@ -594,7 +594,7 @@
ac->ac_group_search = &ocfs2_cluster_group_search;
status = ocfs_reserve_suballoc_bits(osb, ac);
- if (status < 0)
+ if (status < 0 && status != -ENOSPC)
LOG_ERROR_STATUS(status);
bail:
return status;
@@ -647,7 +647,8 @@
if (status == -ENOSPC) {
status = ocfs_reserve_cluster_bitmap_bits(osb, *ac);
if (status < 0) {
- LOG_ERROR_STATUS(status);
+ if (status != -ENOSPC)
+ LOG_ERROR_STATUS(status);
goto bail;
}
}
@@ -845,9 +846,9 @@
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(bg));
OCFS_ASSERT_RO(IS_VALID_GROUP_DESC(prev_bg));
- printk("In suballoc %llu, chain %u, move group %llu to top, "
- "prev = %llu\n", fe->i_blkno, chain, bg->bg_blkno,
- prev_bg->bg_blkno);
+ LOG_TRACE_ARGS("In suballoc %llu, chain %u, move group %llu to top, "
+ "prev = %llu\n", fe->i_blkno, chain, bg->bg_blkno,
+ prev_bg->bg_blkno);
fe_ptr = fe->id2.i_chain.cl_recs[chain].c_blkno;
bg_ptr = bg->bg_next_group;
@@ -984,8 +985,8 @@
ocfs2_group_desc *bg;
chain = ac->ac_chain;
- printk("trying to alloc %u bits from chain %u, inode %llu\n",
- bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
+ LOG_TRACE_ARGS("trying to alloc %u bits from chain %u, inode %llu\n",
+ bits_wanted, chain, OCFS_I(alloc_inode)->ip_blkno);
status = ocfs_read_block(OCFS2_SB(alloc_inode->i_sb),
cl->cl_recs[chain].c_blkno, &group_bh,
@@ -1029,8 +1030,8 @@
goto bail;
}
- printk("alloc succeeds: we give %u bits from block group %llu\n",
- tmp_bits, bg->bg_blkno);
+ LOG_TRACE_ARGS("alloc succeeds: we give %u bits from block group "
+ "%llu\n", tmp_bits, bg->bg_blkno);
*num_bits = tmp_bits;
@@ -1150,6 +1151,9 @@
goto bail;
}
+ LOG_TRACE_ARGS("Search of victim chain %u came up with nothing, "
+ "trying all chains now.\n", victim);
+
/* If we didn't pick a good victim, then just default to
* searching each chain in order. Don't allow chain relinking
* because we only calculate enough journal credits for one
@@ -1401,10 +1405,10 @@
OCFS_ASSERT((count + start_bit)
<= ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
- printk("suballocator %llu: freeing %u bits from group %llu, "
- "starting at %u\n",
- OCFS_I(alloc_inode)->ip_blkno, count, bg_blkno,
- start_bit);
+ LOG_TRACE_ARGS("suballocator %llu: freeing %u bits from group %llu, "
+ "starting at %u\n",
+ OCFS_I(alloc_inode)->ip_blkno, count, bg_blkno,
+ start_bit);
status = ocfs_read_block(osb, bg_blkno, &group_bh, OCFS_BH_CACHED,
alloc_inode);
@@ -1563,10 +1567,10 @@
ocfs2_block_to_cluster_group(bitmap_inode, start_blk, &bg_blkno,
&bg_start_bit);
- printk("want to free %u clusters starting at block %llu\n",
- num_clusters, start_blk);
- printk("bg_blkno = %llu, bg_start_bit = %u\n", bg_blkno,
- bg_start_bit);
+ LOG_TRACE_ARGS("want to free %u clusters starting at block %llu\n",
+ num_clusters, start_blk);
+ LOG_TRACE_ARGS("bg_blkno = %llu, bg_start_bit = %u\n", bg_blkno,
+ bg_start_bit);
status = ocfs_free_suballoc_bits(handle, bitmap_inode, bitmap_bh,
bg_start_bit, bg_blkno,
@@ -1590,7 +1594,6 @@
printk("bg_next_group: %llu\n", bg->bg_next_group);
printk("bg_parent_dinode: %llu\n", bg->bg_parent_dinode);
printk("bg_blkno: %llu\n", bg->bg_blkno);
- return;
}
static inline void debug_suballoc_inode(ocfs2_dinode *fe)
@@ -1610,9 +1613,11 @@
printk("id2.i_chain.cl_next_free_rec: %u\n",
fe->id2.i_chain.cl_next_free_rec);
for(i = 0; i < fe->id2.i_chain.cl_next_free_rec; i++) {
- printk("fe->id2.i_chain.cl_recs[%d].c_free: %u\n", i, fe->id2.i_chain.cl_recs[i].c_free);
- printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i, fe->id2.i_chain.cl_recs[i].c_total);
- printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i, fe->id2.i_chain.cl_recs[i].c_blkno);
+ printk("fe->id2.i_chain.cl_recs[%d].c_free: %u\n", i,
+ fe->id2.i_chain.cl_recs[i].c_free);
+ printk("fe->id2.i_chain.cl_recs[%d].c_total: %u\n", i,
+ fe->id2.i_chain.cl_recs[i].c_total);
+ printk("fe->id2.i_chain.cl_recs[%d].c_blkno: %llu\n", i,
+ fe->id2.i_chain.cl_recs[i].c_blkno);
}
- return;
}
More information about the Ocfs2-commits
mailing list