3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first
     argument is zero

Reviewed by Matt Ahrens <matthew.ahrens@delphix.com>
Reviewed by George Wilson <george.wilson@delphix.com>
Approved by Eric Schrock <eric.schrock@delphix.com>

References:
  illumos/illumos-gate@fb09f5aad4
  https://illumos.org/issues/3006

Requires:
  zfsonlinux/spl@1c6d149feb

Ported-by: Tim Chase <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1509
This commit is contained in:
Madhav Suresh
2013-05-10 14:17:03 -07:00
committed by Brian Behlendorf
parent 9eaf0832ad
commit c99c90015e
32 changed files with 198 additions and 186 deletions
+7 -7
View File
@@ -94,9 +94,9 @@ bptree_free(objset_t *os, uint64_t obj, dmu_tx_t *tx)
VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
bt = db->db_data;
ASSERT3U(bt->bt_begin, ==, bt->bt_end);
ASSERT3U(bt->bt_bytes, ==, 0);
ASSERT3U(bt->bt_comp, ==, 0);
ASSERT3U(bt->bt_uncomp, ==, 0);
ASSERT0(bt->bt_bytes);
ASSERT0(bt->bt_comp);
ASSERT0(bt->bt_uncomp);
dmu_buf_rele(db, FTAG);
return (dmu_object_free(os, obj, tx));
@@ -197,7 +197,7 @@ bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func,
/* save bookmark for future resume */
ASSERT3U(bte.be_zb.zb_objset, ==,
ZB_DESTROYED_OBJSET);
ASSERT3U(bte.be_zb.zb_level, ==, 0);
ASSERT0(bte.be_zb.zb_level);
dmu_write(os, obj, i * sizeof (bte),
sizeof (bte), &bte, tx);
break;
@@ -213,9 +213,9 @@ bptree_iterate(objset_t *os, uint64_t obj, boolean_t free, bptree_itor_t func,
/* if all blocks are free there should be no used space */
if (ba.ba_phys->bt_begin == ba.ba_phys->bt_end) {
ASSERT3U(ba.ba_phys->bt_bytes, ==, 0);
ASSERT3U(ba.ba_phys->bt_comp, ==, 0);
ASSERT3U(ba.ba_phys->bt_uncomp, ==, 0);
ASSERT0(ba.ba_phys->bt_bytes);
ASSERT0(ba.ba_phys->bt_comp);
ASSERT0(ba.ba_phys->bt_uncomp);
}
dmu_buf_rele(db, FTAG);