summaryrefslogtreecommitdiffstats
path: root/module/zfs/dnode_sync.c
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-07-09 12:10:52 -0700
committerBrian Behlendorf <[email protected]>2009-07-09 12:10:52 -0700
commitf1d99c0653911ddfc13414626b288ebada118ba2 (patch)
treedf7de7ff6eea290b698c78df8badc709139e4c95 /module/zfs/dnode_sync.c
parent10dcf485d3dd2aa42ce28231e7cbc979deb394ea (diff)
Revert to original debugging code and wrap any variabled used only
within an ASSERT with the ASSERTV macro which will ensure it will be removed when the ASSERTs are commented out. This makes gcc much happier, makes the variables usage explicit, and removes the need for the compiler to detect it is unused and do the right thing.
Diffstat (limited to 'module/zfs/dnode_sync.c')
-rw-r--r--module/zfs/dnode_sync.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/module/zfs/dnode_sync.c b/module/zfs/dnode_sync.c
index 426aea051..383eac854 100644
--- a/module/zfs/dnode_sync.c
+++ b/module/zfs/dnode_sync.c
@@ -317,10 +317,8 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
ASSERT3U(blkid + nblks, <=, dn->dn_phys->dn_nblkptr);
(void) free_blocks(dn, bp + blkid, nblks, tx);
if (trunc) {
-#ifndef NDEBUG
- uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
- (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT);
-#endif
+ ASSERTV(uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
+ (dn->dn_phys->dn_datablkszsec<<SPA_MINBLOCKSHIFT));
dn->dn_phys->dn_maxblkid = (blkid ? blkid - 1 : 0);
ASSERT(off < dn->dn_phys->dn_maxblkid ||
dn->dn_phys->dn_maxblkid == 0 ||
@@ -349,10 +347,8 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
dbuf_rele(db, FTAG);
}
if (trunc) {
-#ifndef NDEBUG
- uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
- (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT);
-#endif
+ ASSERTV(uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
+ (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT));
dn->dn_phys->dn_maxblkid = (blkid ? blkid - 1 : 0);
ASSERT(off < dn->dn_phys->dn_maxblkid ||
dn->dn_phys->dn_maxblkid == 0 ||
@@ -516,7 +512,7 @@ dnode_sync(dnode_t *dn, dmu_tx_t *tx)
dnode_phys_t *dnp = dn->dn_phys;
int txgoff = tx->tx_txg & TXG_MASK;
list_t *list = &dn->dn_dirty_records[txgoff];
- static const dnode_phys_t zerodn = { 0 };
+ ASSERTV(static const dnode_phys_t zerodn = { 0 });
ASSERT(dmu_tx_is_syncing(tx));
ASSERT(dnp->dn_type != DMU_OT_NONE || dn->dn_allocated_txg);