[Ocfs2-commits] mfasheh commits r2441 - trunk/fs/ocfs2
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Tue Jun 28 16:08:24 CDT 2005
Author: mfasheh
Signed-off-by: manish
Date: 2005-06-27 20:34:51 -0500 (Mon, 27 Jun 2005)
New Revision: 2441
Modified:
trunk/fs/ocfs2/alloc.c
trunk/fs/ocfs2/aops.c
trunk/fs/ocfs2/dir.c
trunk/fs/ocfs2/dlmglue.c
trunk/fs/ocfs2/extent_map.c
trunk/fs/ocfs2/file.c
trunk/fs/ocfs2/heartbeat.c
trunk/fs/ocfs2/inode.c
trunk/fs/ocfs2/journal.c
trunk/fs/ocfs2/journal.h
trunk/fs/ocfs2/localalloc.c
trunk/fs/ocfs2/mmap.c
trunk/fs/ocfs2/namei.c
trunk/fs/ocfs2/ocfs2.h
trunk/fs/ocfs2/slot_map.c
trunk/fs/ocfs2/suballoc.c
trunk/fs/ocfs2/super.c
trunk/fs/ocfs2/vote.c
Log:
* get rid of OCFS2_ASSERT
Signed-off-by: manish
Modified: trunk/fs/ocfs2/alloc.c
===================================================================
--- trunk/fs/ocfs2/alloc.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/alloc.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -129,7 +129,7 @@
} else
el = &fe->id2.i_list;
- OCFS2_ASSERT(el->l_tree_depth == 0);
+ BUG_ON(el->l_tree_depth != 0);
retval = el->l_count - el->l_next_free_rec;
bail:
@@ -264,7 +264,7 @@
mlog_entry_void();
- OCFS2_ASSERT(last_eb_bh);
+ BUG_ON(!last_eb_bh);
fe = (ocfs2_dinode *) fe_bh->b_data;
@@ -275,7 +275,7 @@
el = &fe->id2.i_list;
/* we never add a branch to a leaf. */
- OCFS2_ASSERT(el->l_tree_depth);
+ BUG_ON(!el->l_tree_depth);
new_blocks = el->l_tree_depth;
@@ -546,10 +546,10 @@
i = 0;
while(el->l_tree_depth) {
- OCFS2_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_BUG_ON_RO(!el->l_next_free_rec);
next_blkno = el->l_recs[el->l_next_free_rec-1].e_blkno;
- OCFS2_ASSERT(i < num_bhs);
+ BUG_ON(i >= num_bhs);
status = ocfs2_read_block(osb, next_blkno, &eb_bhs[i],
OCFS2_BH_CACHED, inode);
if (status < 0) {
@@ -571,14 +571,14 @@
/* When we leave this loop, eb_bhs[num_bhs - 1] will
* hold the bottom-most leaf extent block. */
}
- OCFS2_ASSERT(!el->l_tree_depth);
+ BUG_ON(el->l_tree_depth);
el = &fe->id2.i_list;
/* If we have tree depth, then the fe update is
* trivial, and we want to switch el out for the
* bottom-most leaf in order to update it with the
* actual extent data below. */
- OCFS2_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_BUG_ON_RO(!el->l_next_free_rec);
el->l_recs[el->l_next_free_rec - 1].e_clusters += new_clusters;
/* (num_bhs - 1) to avoid the leaf */
for(i = 0; i < (num_bhs - 1); i++) {
@@ -594,12 +594,12 @@
if (status < 0)
mlog_errno(status);
}
- OCFS2_ASSERT(i == (num_bhs - 1));
+ BUG_ON(i != (num_bhs - 1));
/* note that the leaf block wasn't touched in
* the loop above */
eb = (ocfs2_extent_block *) eb_bhs[num_bhs - 1]->b_data;
el = &eb->h_list;
- OCFS2_ASSERT(!el->l_tree_depth);
+ BUG_ON(el->l_tree_depth);
}
/* yay, we can finally add the actual extent now! */
@@ -610,14 +610,14 @@
el->l_recs[i].e_clusters += new_clusters;
} else if (el->l_next_free_rec && !el->l_recs[i].e_clusters) {
/* having an empty extent at eof is legal. */
- OCFS2_ASSERT_RO(el->l_recs[i].e_cpos == fe->i_clusters);
+ OCFS2_BUG_ON_RO(el->l_recs[i].e_cpos != fe->i_clusters);
el->l_recs[i].e_blkno = start_blk;
el->l_recs[i].e_clusters = new_clusters;
} else {
/* No contiguous record, or no empty record at eof, so
* we add a new one. */
- OCFS2_ASSERT(el->l_next_free_rec < el->l_count);
+ BUG_ON(el->l_next_free_rec >= el->l_count);
i = el->l_next_free_rec;
el->l_recs[i].e_blkno = start_blk;
@@ -697,10 +697,10 @@
el = &fe->id2.i_list;
while(el->l_tree_depth > 1) {
- OCFS2_ASSERT_RO(el->l_next_free_rec);
+ OCFS2_BUG_ON_RO(!el->l_next_free_rec);
i = el->l_next_free_rec - 1;
blkno = el->l_recs[i].e_blkno;
- OCFS2_ASSERT_RO(blkno);
+ OCFS2_BUG_ON_RO(!blkno);
if (bh) {
brelse(bh);
@@ -1398,7 +1398,7 @@
eb = (ocfs2_extent_block *) old_last_eb->b_data;
el = &(eb->h_list);
- OCFS2_ASSERT(el->l_next_free_rec);
+ BUG_ON(!el->l_next_free_rec);
/* Make sure that this guy will actually be empty after we
* clear away the data. */
@@ -1417,7 +1417,7 @@
break;
}
}
- OCFS2_ASSERT(i >= 0);
+ BUG_ON(i < 0);
if (bh) {
brelse(bh);
@@ -1495,7 +1495,7 @@
i = el->l_next_free_rec - 1;
- OCFS2_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
+ BUG_ON(el->l_recs[i].e_clusters < clusters_to_del);
el->l_recs[i].e_clusters -= clusters_to_del;
/* tree depth zero, we can just delete the clusters, otherwise
* we need to record the offset of the next level extent block
@@ -1514,7 +1514,7 @@
* the extent block in 'next_eb' */
el->l_recs[i].e_cpos = 0;
el->l_recs[i].e_blkno = 0;
- OCFS2_ASSERT(el->l_next_free_rec);
+ BUG_ON(!el->l_next_free_rec);
el->l_next_free_rec--;
}
@@ -1571,8 +1571,8 @@
goto bail;
}
- OCFS2_ASSERT(el->l_next_free_rec);
- OCFS2_ASSERT(depth == (el->l_tree_depth + 1));
+ BUG_ON(!el->l_next_free_rec);
+ BUG_ON(depth != (el->l_tree_depth + 1));
i = el->l_next_free_rec - 1;
@@ -1582,7 +1582,7 @@
el->l_recs[i].e_cpos, el->l_recs[i].e_clusters,
el->l_recs[i].e_blkno, el->l_next_free_rec);
- OCFS2_ASSERT(el->l_recs[i].e_clusters >= clusters_to_del);
+ BUG_ON(el->l_recs[i].e_clusters < clusters_to_del);
el->l_recs[i].e_clusters -= clusters_to_del;
next_eb = el->l_recs[i].e_blkno;
@@ -1594,7 +1594,7 @@
if (!el->l_recs[i].e_clusters) {
el->l_recs[i].e_cpos = 0;
el->l_recs[i].e_blkno = 0;
- OCFS2_ASSERT(el->l_next_free_rec);
+ BUG_ON(!el->l_next_free_rec);
el->l_next_free_rec--;
}
mlog(0, "extent block %"MLFu64", after: record %d: "
@@ -1614,10 +1614,10 @@
ocfs2_remove_from_cache(inode, eb_bh);
- OCFS2_ASSERT(!eb->h_suballoc_slot);
- OCFS2_ASSERT(!el->l_recs[0].e_clusters);
- OCFS2_ASSERT(!el->l_recs[0].e_cpos);
- OCFS2_ASSERT(!el->l_recs[0].e_blkno);
+ BUG_ON(eb->h_suballoc_slot);
+ BUG_ON(el->l_recs[0].e_clusters);
+ BUG_ON(el->l_recs[0].e_cpos);
+ BUG_ON(el->l_recs[0].e_blkno);
status = ocfs2_free_extent_block(handle,
tc->tc_ext_alloc_inode,
tc->tc_ext_alloc_bh,
@@ -1700,7 +1700,7 @@
if (last_eb != fe->i_last_eb_blk) {
mlog(0, "last_eb changed!\n");
- OCFS2_ASSERT(fe->id2.i_list.l_tree_depth);
+ BUG_ON(!fe->id2.i_list.l_tree_depth);
last_eb = fe->i_last_eb_blk;
/* i_last_eb_blk may have changed, read it if
* necessary. We don't have to worry about the
@@ -1783,7 +1783,7 @@
ocfs2_commit_trans(handle);
handle = NULL;
- OCFS2_ASSERT(fe->i_clusters >= target_i_clusters);
+ BUG_ON(fe->i_clusters < target_i_clusters);
if (fe->i_clusters > target_i_clusters)
goto start;
bail:
@@ -1838,7 +1838,7 @@
mlog(0, "fe->i_clusters = %u, new_i_clusters = %u, fe->i_size ="
"%"MLFu64"\n", fe->i_clusters, new_i_clusters, fe->i_size);
- OCFS2_ASSERT(fe->i_clusters > new_i_clusters);
+ BUG_ON(fe->i_clusters <= new_i_clusters);
*tc = kcalloc(1, sizeof(ocfs2_truncate_context), GFP_KERNEL);
if (!(*tc)) {
Modified: trunk/fs/ocfs2/aops.c
===================================================================
--- trunk/fs/ocfs2/aops.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/aops.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -54,7 +54,7 @@
mlog_entry("(0x%p, %llu, 0x%p, %d)\n", inode,
(unsigned long long)iblock, bh_result, create);
- OCFS2_ASSERT(!ocfs2_inode_is_fast_symlink(inode));
+ BUG_ON(ocfs2_inode_is_fast_symlink(inode));
if ((iblock << inode->i_sb->s_blocksize_bits) > PATH_MAX + 1) {
mlog(ML_ERROR, "block offset > PATH_MAX: %llu",
Modified: trunk/fs/ocfs2/dir.c
===================================================================
--- trunk/fs/ocfs2/dir.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/dir.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -359,7 +359,7 @@
status = ocfs2_extend_allocation(OCFS2_SB(sb), dir, 1,
parent_fe_bh, handle,
data_ac, meta_ac, NULL);
- OCFS2_ASSERT(status != -EAGAIN);
+ BUG_ON(status == -EAGAIN);
if (status < 0) {
mlog_errno(status);
goto bail;
@@ -533,9 +533,9 @@
mlog(0, "getting ready to insert namelen %d into dir %"MLFu64"\n",
namelen, OCFS2_I(dir)->ip_blkno);
- OCFS2_ASSERT(S_ISDIR(dir->i_mode));
+ BUG_ON(!S_ISDIR(dir->i_mode));
fe = (ocfs2_dinode *) parent_fe_bh->b_data;
- OCFS2_ASSERT(fe->i_size == i_size_read(dir));
+ BUG_ON(fe->i_size != i_size_read(dir));
sb = dir->i_sb;
@@ -568,7 +568,7 @@
mlog_errno(status);
goto bail;
}
- OCFS2_ASSERT(bh);
+ BUG_ON(!bh);
*ret_de_bh = bh;
get_bh(*ret_de_bh);
goto bail;
Modified: trunk/fs/ocfs2/dlmglue.c
===================================================================
--- trunk/fs/ocfs2/dlmglue.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/dlmglue.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -147,7 +147,7 @@
static inline struct inode *ocfs2_lock_res_inode(struct ocfs2_lock_res *lockres)
{
- OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
+ BUG_ON(!ocfs2_is_inode_lock(lockres));
return (struct inode *) lockres->l_priv;
}
@@ -253,10 +253,10 @@
mlog_entry_void();
- OCFS2_ASSERT(lockres->l_type == OCFS2_LOCK_TYPE_META);
+ BUG_ON(lockres->l_type != OCFS2_LOCK_TYPE_META);
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(lockres->l_level > LKM_NLMODE);
+ BUG_ON(lockres->l_level <= LKM_NLMODE);
lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb;
if (trunc_clusters)
@@ -396,7 +396,7 @@
{
mlog_entry_void();
- OCFS2_ASSERT(lockres);
+ BUG_ON(!lockres);
switch(level) {
case LKM_EXMODE:
@@ -417,15 +417,15 @@
{
mlog_entry_void();
- OCFS2_ASSERT(lockres);
+ BUG_ON(!lockres);
switch(level) {
case LKM_EXMODE:
- OCFS2_ASSERT(lockres->l_ex_holders);
+ BUG_ON(!lockres->l_ex_holders);
lockres->l_ex_holders--;
break;
case LKM_PRMODE:
- OCFS2_ASSERT(lockres->l_ro_holders);
+ BUG_ON(!lockres->l_ro_holders);
lockres->l_ro_holders--;
break;
default:
@@ -485,10 +485,10 @@
{
mlog_entry_void();
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
- OCFS2_ASSERT(lockres->l_blocking > LKM_NLMODE);
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BUSY));
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
+ BUG_ON(lockres->l_blocking <= LKM_NLMODE);
lockres->l_level = lockres->l_requested;
if (lockres->l_level <=
@@ -505,8 +505,8 @@
{
mlog_entry_void();
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_ATTACHED);
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BUSY));
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
/* Convert from RO to EX doesn't really need anything as our
* information is already up to data. Convert from NL to
@@ -525,8 +525,8 @@
{
mlog_entry_void();
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BUSY);
- OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ BUG_ON((!lockres->l_flags & OCFS2_LOCK_BUSY));
+ BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED);
if (lockres->l_requested > LKM_NLMODE &&
!(lockres->l_flags & OCFS2_LOCK_LOCAL))
@@ -553,7 +553,7 @@
OCFS2_I(inode)->ip_blkno, lockres->l_action,
(lockres->l_type == OCFS2_LOCK_TYPE_META) ? "Meta" : "Data");
- OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
+ BUG_ON(!ocfs2_is_inode_lock(lockres));
spin_lock(&lockres->l_lock);
@@ -636,7 +636,7 @@
mlog_entry_void();
- OCFS2_ASSERT(ocfs2_is_inode_lock(lockres));
+ BUG_ON(!ocfs2_is_inode_lock(lockres));
inode = ocfs2_lock_res_inode(lockres);
osb = OCFS2_SB(inode->i_sb);
@@ -646,7 +646,7 @@
lockres->l_level,
(lockres->l_type == OCFS2_LOCK_TYPE_META) ? "Meta" : "Data");
- OCFS2_ASSERT(level > LKM_NLMODE);
+ BUG_ON(level <= LKM_NLMODE);
spin_lock(&lockres->l_lock);
@@ -904,7 +904,7 @@
static inline int ocfs2_may_continue_on_blocked_lock(struct ocfs2_lock_res *lockres,
int wanted)
{
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
return wanted <= ocfs2_highest_compat_lock_level(lockres->l_blocking);
}
@@ -1008,8 +1008,8 @@
lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
spin_unlock(&lockres->l_lock);
- OCFS2_ASSERT(level != LKM_IVMODE);
- OCFS2_ASSERT(level != LKM_NLMODE);
+ BUG_ON(level == LKM_IVMODE);
+ BUG_ON(level == LKM_NLMODE);
mlog(0, "lock %s, convert from %d to level = %d\n",
lockres->l_name, lockres->l_level, level);
@@ -1092,8 +1092,8 @@
ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct ocfs2_lock_res *lockres;
- OCFS2_ASSERT(inode);
- OCFS2_ASSERT(ocfs2_inode_is_new(inode));
+ BUG_ON(!inode);
+ BUG_ON(!ocfs2_inode_is_new(inode));
mlog_entry_void();
@@ -1110,7 +1110,7 @@
lockres = &OCFS2_I(inode)->ip_meta_lockres;
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED);
lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
spin_unlock(&lockres->l_lock);
@@ -1123,7 +1123,7 @@
lockres = &OCFS2_I(inode)->ip_data_lockres;
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(!(lockres->l_flags & OCFS2_LOCK_ATTACHED));
+ BUG_ON(lockres->l_flags & OCFS2_LOCK_ATTACHED);
lockres_or_flags(lockres, OCFS2_LOCK_LOCAL);
spin_unlock(&lockres->l_lock);
@@ -1145,7 +1145,7 @@
int status, level;
struct ocfs2_lock_res *lockres;
- OCFS2_ASSERT(inode);
+ BUG_ON(!inode);
mlog_entry_void();
@@ -1564,7 +1564,7 @@
ocfs2_super *osb = OCFS2_SB(inode->i_sb);
struct buffer_head *local_bh = NULL;
- OCFS2_ASSERT(inode);
+ BUG_ON(!inode);
mlog_entry_void();
@@ -1865,7 +1865,7 @@
/* make sure we never get here while waiting for an ast to
* fire. */
- OCFS2_ASSERT(lockres->l_action == OCFS2_AST_INVALID);
+ BUG_ON(lockres->l_action != OCFS2_AST_INVALID);
/* is this necessary? */
lockres_or_flags(lockres, OCFS2_LOCK_BUSY);
@@ -2004,7 +2004,7 @@
mlog_entry_void();
- OCFS2_ASSERT(lockres->l_blocking > LKM_NLMODE);
+ BUG_ON(lockres->l_blocking <= LKM_NLMODE);
if (lockres->l_level <= new_level) {
mlog(ML_ERROR, "lockres->l_level (%u) <= new_level (%u)\n",
@@ -2056,8 +2056,8 @@
mlog(0, "lock %s\n", lockres->l_name);
/* were we in a convert when we got the bast fire? */
- OCFS2_ASSERT(lockres->l_action == OCFS2_AST_CONVERT ||
- lockres->l_action == OCFS2_AST_DOWNCONVERT);
+ BUG_ON(lockres->l_action != OCFS2_AST_CONVERT &&
+ lockres->l_action != OCFS2_AST_DOWNCONVERT);
/* set things up for the unlockast to know to just
* clear out the ast_action and unset busy, etc. */
lockres->l_unlock_action = OCFS2_UNLOCK_CANCEL_CONVERT;
@@ -2099,7 +2099,7 @@
mlog_entry_void();
- OCFS2_ASSERT(new_level == LKM_NLMODE || new_level == LKM_PRMODE);
+ BUG_ON(new_level != LKM_NLMODE && new_level != LKM_PRMODE);
if (lockres->l_flags & OCFS2_LOCK_REFRESHING) {
ret = 0;
@@ -2130,13 +2130,13 @@
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
mlog(0, "l_level=%d, l_blocking=%d\n", lockres->l_level,
lockres->l_blocking);
- OCFS2_ASSERT(lockres->l_level == LKM_EXMODE ||
- lockres->l_level == LKM_PRMODE);
+ BUG_ON(lockres->l_level != LKM_EXMODE &&
+ lockres->l_level != LKM_PRMODE);
if (lockres->l_flags & OCFS2_LOCK_BUSY) {
*requeue = 1;
@@ -2208,7 +2208,7 @@
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(lockres->l_flags & OCFS2_LOCK_BLOCKED);
+ BUG_ON(!(lockres->l_flags & OCFS2_LOCK_BLOCKED));
recheck:
if (lockres->l_flags & OCFS2_LOCK_BUSY) {
@@ -2411,9 +2411,9 @@
mlog_entry_void();
- OCFS2_ASSERT(lockres);
- OCFS2_ASSERT(lockres->l_ops);
- OCFS2_ASSERT(lockres->l_ops->unblock);
+ BUG_ON(!lockres);
+ BUG_ON(!lockres->l_ops);
+ BUG_ON(!lockres->l_ops->unblock);
mlog(0, "lockres %s blocked.\n", lockres->l_name);
@@ -2470,7 +2470,7 @@
struct ocfs2_meta_lvb *lvb;
spin_lock(&lockres->l_lock);
- OCFS2_ASSERT(lockres->l_level == LKM_EXMODE);
+ BUG_ON(lockres->l_level != LKM_EXMODE);
lvb = (struct ocfs2_meta_lvb *) lockres->l_lksb.lvb;
if (be32_to_cpu(lvb->lvb_trunc_clusters) > trunc_clusters)
Modified: trunk/fs/ocfs2/extent_map.c
===================================================================
--- trunk/fs/ocfs2/extent_map.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/extent_map.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -542,8 +542,8 @@
struct ocfs2_extent_map_entry *ent;
ocfs2_extent_rec *old;
- OCFS2_ASSERT(new_clusters);
- OCFS2_ASSERT(rec->e_clusters >= new_clusters);
+ BUG_ON(!new_clusters);
+ BUG_ON(rec->e_clusters < new_clusters);
if (em->em_clusters < OCFS2_I(inode)->ip_clusters) {
/*
@@ -575,13 +575,12 @@
NULL, NULL);
if (ent) {
old = &ent->e_rec;
- OCFS2_ASSERT((rec->e_cpos + rec->e_clusters) ==
+ BUG_ON((rec->e_cpos + rec->e_clusters) !=
(old->e_cpos + old->e_clusters +
new_clusters));
if (!ent->e_tree_depth) {
- OCFS2_ASSERT(old->e_cpos == rec->e_cpos);
- OCFS2_ASSERT(old->e_blkno ==
- rec->e_blkno);
+ BUG_ON(old->e_cpos != rec->e_cpos);
+ BUG_ON(old->e_blkno != rec->e_blkno);
ret = 0;
}
/*
Modified: trunk/fs/ocfs2/file.c
===================================================================
--- trunk/fs/ocfs2/file.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/file.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -619,7 +619,7 @@
u32 bit_off, num_bits;
u64 block;
- OCFS2_ASSERT(clusters_to_add);
+ BUG_ON(!clusters_to_add);
free_extents = ocfs2_num_free_extents(osb, inode, fe);
if (free_extents < 0) {
@@ -657,7 +657,7 @@
goto leave;
}
- OCFS2_ASSERT(num_bits <= clusters_to_add);
+ BUG_ON(num_bits > clusters_to_add);
/* reserve our write early -- insert_extent may update the inode */
status = ocfs2_journal_access(handle, inode, fe_bh,
@@ -754,8 +754,8 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS2_ASSERT(i_size_read(inode) == (fe->i_size - *bytes_extended));
- OCFS2_ASSERT(new_i_size >= i_size_read(inode));
+ BUG_ON(i_size_read(inode) != (fe->i_size - *bytes_extended));
+ BUG_ON(new_i_size < i_size_read(inode));
if (i_size_read(inode) == new_i_size)
goto leave;
@@ -856,7 +856,7 @@
mlog(0, "restarting function.\n");
restart_func = 1;
} else {
- OCFS2_ASSERT(why == RESTART_TRANS);
+ BUG_ON(why != RESTART_TRANS);
new_fe_size = ocfs2_clusters_to_bytes(osb->sb,
fe->i_clusters);
Modified: trunk/fs/ocfs2/heartbeat.c
===================================================================
--- trunk/fs/ocfs2/heartbeat.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/heartbeat.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -72,7 +72,7 @@
static void ocfs2_do_node_down(int node_num,
ocfs2_super *osb)
{
- OCFS2_ASSERT(osb->node_num != node_num);
+ BUG_ON(osb->node_num == node_num);
mlog(0, "ocfs2: node down event for %d\n", node_num);
@@ -126,7 +126,7 @@
{
ocfs2_super *osb = data;
- OCFS2_ASSERT(osb->node_num != node_num);
+ BUG_ON(osb->node_num == node_num);
mlog(0, "node up event for %d\n", node_num);
ocfs2_node_map_clear_bit(osb, &osb->umount_map, node_num);
@@ -230,7 +230,7 @@
{
if (bit==-1)
return;
- OCFS2_ASSERT(bit < map->num_nodes);
+ BUG_ON(bit >= map->num_nodes);
spin_lock(&osb->node_map_lock);
__ocfs2_node_map_set_bit(map, bit);
spin_unlock(&osb->node_map_lock);
@@ -248,7 +248,7 @@
{
if (bit==-1)
return;
- OCFS2_ASSERT(bit < map->num_nodes);
+ BUG_ON(bit >= map->num_nodes);
spin_lock(&osb->node_map_lock);
__ocfs2_node_map_clear_bit(map, bit);
spin_unlock(&osb->node_map_lock);
@@ -282,7 +282,7 @@
ocfs2_node_map *map)
{
int ret;
- OCFS2_ASSERT(map->num_nodes > 0);
+ BUG_ON(map->num_nodes == 0);
spin_lock(&osb->node_map_lock);
ret = __ocfs2_node_map_is_empty(map);
spin_unlock(&osb->node_map_lock);
@@ -292,7 +292,7 @@
static void __ocfs2_node_map_dup(ocfs2_node_map *target,
ocfs2_node_map *from)
{
- OCFS2_ASSERT(from->num_nodes > 0);
+ BUG_ON(from->num_nodes == 0);
ocfs2_node_map_init(target);
__ocfs2_node_map_set(target, from);
}
@@ -319,8 +319,8 @@
{
int num_longs, i;
- OCFS2_ASSERT(target->num_nodes == from->num_nodes);
- OCFS2_ASSERT(target->num_nodes > 0);
+ BUG_ON(target->num_nodes != from->num_nodes);
+ BUG_ON(target->num_nodes == 0);
num_longs = BITS_TO_LONGS(target->num_nodes);
for (i = 0; i < num_longs; i++)
Modified: trunk/fs/ocfs2/inode.c
===================================================================
--- trunk/fs/ocfs2/inode.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/inode.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -835,7 +835,7 @@
if (((u64)block << inode->i_sb->s_blocksize_bits) >=
i_size_read(inode)) {
- OCFS2_ASSERT(reada);
+ BUG_ON(!reada);
return NULL;
}
Modified: trunk/fs/ocfs2/journal.c
===================================================================
--- trunk/fs/ocfs2/journal.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/journal.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -150,8 +150,8 @@
if (!osb || !osb->journal->j_journal)
BUG();
- OCFS2_ASSERT(osb->journal->j_state != OCFS2_JOURNAL_FREE);
- OCFS2_ASSERT(max_buffs > 0);
+ BUG_ON(osb->journal->j_state == OCFS2_JOURNAL_FREE);
+ BUG_ON(max_buffs <= 0);
/* JBD might support this, but our journalling code doesn't yet. */
if (journal_current_handle()) {
@@ -200,8 +200,8 @@
void ocfs2_handle_add_inode(ocfs2_journal_handle *handle,
struct inode *inode)
{
- OCFS2_ASSERT(handle);
- OCFS2_ASSERT(inode);
+ BUG_ON(!handle);
+ BUG_ON(!inode);
atomic_inc(&inode->i_count);
@@ -209,8 +209,8 @@
down(&inode->i_sem);
/* sanity check */
- OCFS2_ASSERT(!OCFS2_I(inode)->ip_handle);
- OCFS2_ASSERT(list_empty(&OCFS2_I(inode)->ip_handle_list));
+ BUG_ON(OCFS2_I(inode)->ip_handle);
+ BUG_ON(!list_empty(&OCFS2_I(inode)->ip_handle_list));
OCFS2_I(inode)->ip_handle = handle;
list_del(&(OCFS2_I(inode)->ip_handle_list));
@@ -242,7 +242,7 @@
{
mlog_entry_void();
- OCFS2_ASSERT(!(handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(handle->flags & OCFS2_HANDLE_STARTED);
ocfs2_handle_unlock_inodes(handle);
/* You are allowed to add journal locks before the transaction
@@ -262,7 +262,7 @@
mlog_entry_void();
- OCFS2_ASSERT(handle);
+ BUG_ON(!handle);
if (!(handle->flags & OCFS2_HANDLE_STARTED)) {
ocfs2_commit_unstarted_handle(handle);
@@ -323,9 +323,9 @@
{
int status;
- OCFS2_ASSERT(handle);
- OCFS2_ASSERT(handle->flags & OCFS2_HANDLE_STARTED);
- OCFS2_ASSERT(nblocks);
+ BUG_ON(!handle);
+ BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(!nblocks);
mlog_entry_void();
@@ -363,10 +363,10 @@
{
int status;
- OCFS2_ASSERT(inode);
- OCFS2_ASSERT(handle);
- OCFS2_ASSERT(bh);
- OCFS2_ASSERT((handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(!inode);
+ BUG_ON(!handle);
+ BUG_ON(!bh);
+ BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED));
mlog_entry("bh->b_blocknr=%llu, type=%d (\"%s\"), bh->b_size = %hu\n",
(unsigned long long)bh->b_blocknr, type,
@@ -413,7 +413,7 @@
{
int status;
- OCFS2_ASSERT((handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(!(handle->flags & OCFS2_HANDLE_STARTED));
mlog_entry("(bh->b_blocknr=%llu)\n",
(unsigned long long)bh->b_blocknr);
@@ -435,7 +435,7 @@
int status;
ocfs2_journal_lock *lock;
- OCFS2_ASSERT(inode);
+ BUG_ON(!inode);
lock = kmem_cache_alloc(ocfs2_lock_cache, GFP_NOFS);
if (!lock) {
@@ -497,7 +497,7 @@
mlog_entry_void();
- OCFS2_ASSERT(journal);
+ BUG_ON(!journal);
osb = journal->j_osb;
@@ -666,7 +666,7 @@
osb->commit_task = NULL;
}
- OCFS2_ASSERT(atomic_read(&(osb->journal->j_num_trans)) == 0);
+ BUG_ON(atomic_read(&(osb->journal->j_num_trans)) != 0);
status = ocfs2_journal_toggle_dirty(osb, 0);
if (status < 0)
@@ -787,8 +787,8 @@
mlog_entry_void();
- OCFS2_ASSERT(inode->i_blocks ==
- ocfs2_align_bytes_to_sectors(i_size_read(inode)));
+ BUG_ON(inode->i_blocks !=
+ ocfs2_align_bytes_to_sectors(i_size_read(inode)));
memset(bhs, 0, sizeof(struct buffer_head *) * CONCURRENT_JOURNAL_FILL);
Modified: trunk/fs/ocfs2/journal.h
===================================================================
--- trunk/fs/ocfs2/journal.h 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/journal.h 2005-06-28 01:34:51 UTC (rev 2441)
@@ -434,7 +434,7 @@
int i;
i = last_el->l_next_free_rec - 1;
- OCFS2_ASSERT(i >= 0);
+ BUG_ON(i < 0);
/* We may be deleting metadata blocks, so metadata alloc dinode +
one desc. block for each possible delete. */
Modified: trunk/fs/ocfs2/localalloc.c
===================================================================
--- trunk/fs/ocfs2/localalloc.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/localalloc.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -455,9 +455,9 @@
mlog_entry_void();
- OCFS2_ASSERT(passed_handle);
- OCFS2_ASSERT(ac);
- OCFS2_ASSERT(!(passed_handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(!passed_handle);
+ BUG_ON(!ac);
+ BUG_ON(passed_handle->flags & OCFS2_HANDLE_STARTED);
local_alloc_inode =
ocfs2_get_system_file_inode(osb,
@@ -483,8 +483,8 @@
alloc = (ocfs2_dinode *) osb->local_alloc_bh->b_data;
- OCFS2_ASSERT(le32_to_cpu(alloc->id1.bitmap1.i_used) ==
- ocfs2_local_alloc_count_bits(alloc));
+ OCFS2_BUG_ON_RO(le32_to_cpu(alloc->id1.bitmap1.i_used) !=
+ ocfs2_local_alloc_count_bits(alloc));
free_bits = le32_to_cpu(alloc->id1.bitmap1.i_total) -
le32_to_cpu(alloc->id1.bitmap1.i_used);
@@ -526,7 +526,7 @@
ocfs2_dinode *alloc;
mlog_entry_void();
- OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_LOCAL);
+ BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL);
bits_wanted = ac->ac_bits_wanted - ac->ac_bits_given;
local_alloc_inode = ac->ac_inode;
Modified: trunk/fs/ocfs2/mmap.c
===================================================================
--- trunk/fs/ocfs2/mmap.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/mmap.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -168,7 +168,7 @@
{
struct inode *inode = binode->ba_inode;
- OCFS2_ASSERT(inode);
+ BUG_ON(!inode);
return OCFS2_I(inode)->ip_blkno;
}
@@ -188,8 +188,8 @@
struct rb_node * parent = NULL;
struct rb_node ** p = &ctxt->b_inodes.rb_node;
- OCFS2_ASSERT(ctxt);
- OCFS2_ASSERT(inode);
+ BUG_ON(!ctxt);
+ BUG_ON(!inode);
blkno = OCFS2_I(inode)->ip_blkno;
@@ -269,7 +269,7 @@
if (!skip_sem)
down_read(&mm->mmap_sem);
- OCFS2_ASSERT(!__ocfs2_buffer_lock_ctxt_root(ctxt));
+ BUG_ON(__ocfs2_buffer_lock_ctxt_root(ctxt));
/* We always insert target because it might not be backing part of the
* buffer - but it needs to be in there so that it's lock gets ordered
Modified: trunk/fs/ocfs2/namei.c
===================================================================
--- trunk/fs/ocfs2/namei.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/namei.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -514,7 +514,6 @@
(unsigned long)dev, dentry->d_name.len,
dentry->d_name.name);
- OCFS2_ASSERT(new_fe_bh);
*new_fe_bh = NULL;
*ret_inode = NULL;
@@ -802,7 +801,7 @@
mlog_entry("(0x%p, 0x%p, '%.*s')\n", dir, dentry,
dentry->d_name.len, dentry->d_name.name);
- OCFS2_ASSERT((dentry->d_parent->d_inode == dir));
+ BUG_ON(dentry->d_parent->d_inode != dir);
mlog(0, "ino = %"MLFu64"\n", OCFS2_I(inode)->ip_blkno);
@@ -987,7 +986,7 @@
mlog_entry("(inode1 = %"MLFu64", inode2 = %"MLFu64")\n",
oi1->ip_blkno, oi2->ip_blkno);
- OCFS2_ASSERT(handle);
+ BUG_ON(!handle);
if (*bh1)
*bh1 = NULL;
@@ -1775,7 +1774,6 @@
int retval, status;
mlog_entry_void();
- OCFS2_ASSERT(insert_bh);
sb = dir->i_sb;
@@ -1786,7 +1784,7 @@
offset = 0;
de = (struct ocfs2_dir_entry *) insert_bh->b_data;
while (1) {
- OCFS2_ASSERT((char *)de < sb->s_blocksize + insert_bh->b_data);
+ BUG_ON((char *)de >= sb->s_blocksize + insert_bh->b_data);
/* These checks should've already been passed by the
* prepare function, but I guess we can leave them
* here anyway. */
Modified: trunk/fs/ocfs2/ocfs2.h
===================================================================
--- trunk/fs/ocfs2/ocfs2.h 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/ocfs2.h 2005-06-28 01:34:51 UTC (rev 2441)
@@ -287,17 +287,10 @@
#define OCFS2_SB(sb) ((ocfs2_super *)(sb)->s_fs_info)
#define OCFS2_MAX_OSB_ID 65536
-#define OCFS2_ASSERT(cond) do { if (unlikely(!(cond))) BUG(); } while (0)
+/* Helps document which BUG's should really just force the file system
+ * to go readonly */
+#define OCFS2_BUG_ON_RO(x) BUG_ON((x))
-#define OCFS2_ASSERT_RO(x) \
- do { \
- if (unlikely(!(x))) { \
- printk(KERN_ERR "This should make OCFS2 " \
- "remount RO\n"); \
- BUG(); \
- } \
- } while (0)
-
#define OCFS2_IS_VALID_DINODE(ptr) \
(!strcmp((ptr)->i_signature, OCFS2_INODE_SIGNATURE))
Modified: trunk/fs/ocfs2/slot_map.c
===================================================================
--- trunk/fs/ocfs2/slot_map.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/slot_map.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -150,10 +150,10 @@
s16 slot_num,
s16 node_num)
{
- OCFS2_ASSERT(slot_num != OCFS2_INVALID_SLOT);
- OCFS2_ASSERT(slot_num < si->si_num_slots);
- OCFS2_ASSERT((node_num == O2NM_INVALID_NODE_NUM) ||
- (node_num < O2NM_MAX_NODES));
+ BUG_ON(slot_num == OCFS2_INVALID_SLOT);
+ BUG_ON(slot_num >= si->si_num_slots);
+ BUG_ON((node_num != O2NM_INVALID_NODE_NUM) &&
+ (node_num >= O2NM_MAX_NODES));
si->si_global_node_nums[slot_num] = node_num;
}
Modified: trunk/fs/ocfs2/suballoc.c
===================================================================
--- trunk/fs/ocfs2/suballoc.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/suballoc.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -150,7 +150,7 @@
mlog_entry_void();
- OCFS2_ASSERT(((unsigned long long) bg_bh->b_blocknr) == group_blkno);
+ OCFS2_BUG_ON_RO(((unsigned long long) bg_bh->b_blocknr) != group_blkno);
status = ocfs2_journal_access(handle,
alloc_inode,
@@ -219,7 +219,7 @@
struct buffer_head *bg_bh = NULL;
ocfs2_group_desc *bg;
- OCFS2_ASSERT(!ocfs2_is_cluster_bitmap(alloc_inode));
+ BUG_ON(ocfs2_is_cluster_bitmap(alloc_inode));
mlog_entry_void();
@@ -355,7 +355,7 @@
mlog_entry_void();
- OCFS2_ASSERT(!(handle->flags & OCFS2_HANDLE_STARTED));
+ BUG_ON(handle->flags & OCFS2_HANDLE_STARTED);
ocfs2_handle_add_inode(handle, alloc_inode);
status = ocfs2_meta_lock(alloc_inode, handle, &bh, 1);
@@ -366,7 +366,7 @@
fe = (ocfs2_dinode *) bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS2_ASSERT_RO(fe->i_flags & OCFS2_CHAIN_FL);
+ OCFS2_BUG_ON_RO(!(fe->i_flags & OCFS2_CHAIN_FL));
free_bits = le32_to_cpu(fe->id1.bitmap1.i_total) -
le32_to_cpu(fe->id1.bitmap1.i_used);
@@ -389,9 +389,9 @@
atomic_inc(&osb->alloc_stats.bg_extends);
/* You should never ask for this much metadata */
- OCFS2_ASSERT(bits_wanted <=
- (le32_to_cpu(fe->id1.bitmap1.i_total)
- - le32_to_cpu(fe->id1.bitmap1.i_used)));
+ BUG_ON(bits_wanted >
+ (le32_to_cpu(fe->id1.bitmap1.i_total)
+ - le32_to_cpu(fe->id1.bitmap1.i_used)));
}
get_bh(bh);
@@ -550,7 +550,7 @@
mlog_entry_void();
- OCFS2_ASSERT(handle);
+ BUG_ON(!handle);
*ac = kcalloc(1, sizeof(ocfs2_alloc_context), GFP_KERNEL);
if (!(*ac)) {
@@ -718,7 +718,7 @@
mlog_entry_void();
OCFS2_BUG_ON_INVALID_GROUP_DESC(bg);
- OCFS2_ASSERT(bg->bg_free_bits_count >= num_bits);
+ BUG_ON(bg->bg_free_bits_count < num_bits);
mlog(0, "block_group_set_bits: off = %u, num = %u\n", bit_off,
num_bits);
@@ -757,7 +757,7 @@
{
u16 curr, best;
- OCFS2_ASSERT(cl->cl_next_free_rec);
+ BUG_ON(!cl->cl_next_free_rec);
best = curr = 0;
while (curr < cl->cl_next_free_rec) {
@@ -766,7 +766,7 @@
curr++;
}
- OCFS2_ASSERT(best < cl->cl_next_free_rec);
+ BUG_ON(best >= cl->cl_next_free_rec);
return best;
}
@@ -872,7 +872,7 @@
ocfs2_group_desc *bg = (ocfs2_group_desc *) group_bh->b_data;
u16 tmp_off, tmp_found;
- OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ BUG_ON(!ocfs2_is_cluster_bitmap(inode));
if (bg->bg_free_bits_count) {
ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
@@ -898,8 +898,8 @@
int ret = -ENOSPC;
ocfs2_group_desc *bg = (ocfs2_group_desc *) group_bh->b_data;
- OCFS2_ASSERT(min_bits == 1);
- OCFS2_ASSERT(!ocfs2_is_cluster_bitmap(inode));
+ BUG_ON(min_bits != 1);
+ BUG_ON(ocfs2_is_cluster_bitmap(inode));
if (bg->bg_free_bits_count)
ret = ocfs2_block_group_find_clear_bits(OCFS2_SB(inode->i_sb),
@@ -979,7 +979,7 @@
*num_bits = tmp_bits;
- OCFS2_ASSERT(*num_bits);
+ BUG_ON(*num_bits == 0);
/*
* Keep track of previous block descriptor read. When
@@ -1069,14 +1069,14 @@
mlog_entry_void();
- OCFS2_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
- OCFS2_ASSERT(bits_wanted <= (ac->ac_bits_wanted - ac->ac_bits_given));
- OCFS2_ASSERT(ac->ac_bh);
+ BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted);
+ BUG_ON(bits_wanted > (ac->ac_bits_wanted - ac->ac_bits_given));
+ BUG_ON(!ac->ac_bh);
fe = (ocfs2_dinode *) ac->ac_bh->b_data;
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS2_ASSERT_RO(le32_to_cpu(fe->id1.bitmap1.i_used) <
- le32_to_cpu(fe->id1.bitmap1.i_total));
+ OCFS2_BUG_ON_RO(le32_to_cpu(fe->id1.bitmap1.i_used) >=
+ le32_to_cpu(fe->id1.bitmap1.i_total));
cl = (ocfs2_chain_list *) &fe->id2.i_chain;
@@ -1135,10 +1135,10 @@
int status;
u64 bg_blkno;
- OCFS2_ASSERT(ac);
- OCFS2_ASSERT(ac->ac_bits_wanted >= (ac->ac_bits_given + bits_wanted));
- OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_META);
- OCFS2_ASSERT(ac->ac_handle == handle);
+ BUG_ON(!ac);
+ BUG_ON(ac->ac_bits_wanted < (ac->ac_bits_given + bits_wanted));
+ BUG_ON(ac->ac_which != OCFS2_AC_USE_META);
+ BUG_ON(ac->ac_handle != handle);
status = ocfs2_claim_suballoc_bits(osb,
ac,
@@ -1173,11 +1173,11 @@
mlog_entry_void();
- OCFS2_ASSERT(ac);
- OCFS2_ASSERT(ac->ac_bits_given == 0);
- OCFS2_ASSERT(ac->ac_bits_wanted == 1);
- OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_INODE);
- OCFS2_ASSERT(ac->ac_handle == handle);
+ BUG_ON(!ac);
+ BUG_ON(ac->ac_bits_given != 0);
+ BUG_ON(ac->ac_bits_wanted != 1);
+ BUG_ON(ac->ac_which != OCFS2_AC_USE_INODE);
+ BUG_ON(ac->ac_handle != handle);
status = ocfs2_claim_suballoc_bits(osb,
ac,
@@ -1192,7 +1192,7 @@
}
atomic_inc(&osb->alloc_stats.bg_allocs);
- OCFS2_ASSERT(num_bits == 1);
+ BUG_ON(num_bits != 1);
*fe_blkno = bg_blkno + (u64) (*suballoc_bit);
ac->ac_bits_given++;
@@ -1211,7 +1211,7 @@
ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 cluster = 0;
- OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ BUG_ON(!ocfs2_is_cluster_bitmap(inode));
if (bg_blkno != osb->first_cluster_group_blkno)
cluster = ocfs2_blocks_to_clusters(inode->i_sb, bg_blkno);
@@ -1227,7 +1227,7 @@
ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 group_no;
- OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ BUG_ON(!ocfs2_is_cluster_bitmap(inode));
group_no = cluster / osb->bitmap_cpg;
if (!group_no)
@@ -1246,7 +1246,7 @@
ocfs2_super *osb = OCFS2_SB(inode->i_sb);
u32 data_cluster = ocfs2_blocks_to_clusters(osb->sb, data_blkno);
- OCFS2_ASSERT(ocfs2_is_cluster_bitmap(inode));
+ BUG_ON(!ocfs2_is_cluster_bitmap(inode));
*bg_blkno = ocfs2_which_cluster_group(inode,
data_cluster);
@@ -1278,12 +1278,12 @@
mlog_entry_void();
- OCFS2_ASSERT(ac);
- OCFS2_ASSERT(ac->ac_bits_given < ac->ac_bits_wanted);
+ BUG_ON(!ac);
+ BUG_ON(ac->ac_bits_given >= ac->ac_bits_wanted);
- OCFS2_ASSERT(ac->ac_which == OCFS2_AC_USE_LOCAL
- || ac->ac_which == OCFS2_AC_USE_MAIN);
- OCFS2_ASSERT(ac->ac_handle == handle);
+ BUG_ON(ac->ac_which != OCFS2_AC_USE_LOCAL
+ && ac->ac_which != OCFS2_AC_USE_MAIN);
+ BUG_ON(ac->ac_handle != handle);
if (ac->ac_which == OCFS2_AC_USE_LOCAL) {
status = ocfs2_claim_local_alloc_bits(osb,
@@ -1404,8 +1404,8 @@
mlog_entry_void();
OCFS2_BUG_ON_INVALID_DINODE(fe);
- OCFS2_ASSERT((count + start_bit)
- <= ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
+ BUG_ON((count + start_bit) >
+ ((u32) cl->cl_cpg * (u32) cl->cl_bpc));
mlog(0, "suballocator %"MLFu64": freeing %u bits from group %"MLFu64
", starting at %u\n",
@@ -1421,7 +1421,7 @@
group = (ocfs2_group_desc *) group_bh->b_data;
OCFS2_BUG_ON_INVALID_GROUP_DESC(group);
- OCFS2_ASSERT((count + start_bit) <= group->bg_bits);
+ BUG_ON((count + start_bit) > group->bg_bits);
status = ocfs2_block_group_clear_bits(handle, alloc_inode,
group, group_bh,
Modified: trunk/fs/ocfs2/super.c
===================================================================
--- trunk/fs/ocfs2/super.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/super.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -335,7 +335,7 @@
#if BITS_PER_LONG == 32
# if defined(CONFIG_LBD)
- OCFS2_ASSERT(sizeof(sector_t) == 8);
+ BUG_ON(sizeof(sector_t) != 8);
pagefactor = PAGE_CACHE_SIZE;
bitshift = BITS_PER_LONG;
# else
@@ -996,9 +996,9 @@
mlog_entry("(0x%p)\n", sb);
- OCFS2_ASSERT(sb);
+ BUG_ON(!sb);
osb = OCFS2_SB(sb);
- OCFS2_ASSERT(osb);
+ BUG_ON(!osb);
ocfs2_wait_for_okp_destruction(osb);
Modified: trunk/fs/ocfs2/vote.c
===================================================================
--- trunk/fs/ocfs2/vote.c 2005-06-28 01:03:13 UTC (rev 2440)
+++ trunk/fs/ocfs2/vote.c 2005-06-28 01:34:51 UTC (rev 2441)
@@ -490,7 +490,7 @@
processed = osb->blocked_lock_count;
while (processed) {
- OCFS2_ASSERT(!list_empty(&osb->blocked_lock_list));
+ BUG_ON(list_empty(&osb->blocked_lock_list));
lockres = list_entry(osb->blocked_lock_list.next,
struct ocfs2_lock_res, l_blocked_list);
@@ -498,7 +498,7 @@
osb->blocked_lock_count--;
spin_unlock(&osb->vote_task_lock);
- OCFS2_ASSERT(processed);
+ BUG_ON(!processed);
processed--;
ocfs2_process_blocked_lock(osb, lockres);
@@ -507,7 +507,7 @@
}
while (osb->vote_count) {
- OCFS2_ASSERT(!list_empty(&osb->vote_list));
+ BUG_ON(list_empty(&osb->vote_list));
work = list_entry(osb->vote_list.next,
ocfs2_vote_work, w_list);
list_del(&work->w_list);
More information about the Ocfs2-commits
mailing list