Skip to content

Commit

Permalink
Wrap vdev_count_verify_zaps() with DEBUG
Browse files Browse the repository at this point in the history
Commit e0ab3ab introduced two blocks of code which are only needed
when debugging is enabled.  These blocks should be wrapped with a
DEBUG for clarity and to prevent unused variable warnings during
a production build.

Signed-off-by: Brian Behlendorf <[email protected]>
Issue openzfs#4515
  • Loading branch information
behlendorf committed May 6, 2016
1 parent 4b2a3e0 commit 7131ef4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions module/zfs/spa.c
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,7 @@ spa_load(spa_t *spa, spa_load_state_t state, spa_import_type_t type,
return (error);
}

#ifdef ZFS_DEBUG
/*
* Count the number of per-vdev ZAPs associated with all of the vdevs in the
* vdev tree rooted in the given vd, and ensure that each ZAP is present in the
Expand Down Expand Up @@ -2267,6 +2268,7 @@ vdev_count_verify_zaps(vdev_t *vd)

return (total);
}
#endif

/*
* Load an existing storage pool, using the pool's builtin spa_config as a
Expand Down Expand Up @@ -6714,6 +6716,7 @@ spa_sync(spa_t *spa, uint64_t txg)

} while (dmu_objset_is_dirty(mos, txg));

#ifdef ZFS_DEBUG
if (!list_is_empty(&spa->spa_config_dirty_list)) {
/*
* Make sure that the number of ZAPs for all the vdevs matches
Expand All @@ -6728,6 +6731,7 @@ spa_sync(spa_t *spa, uint64_t txg)
ASSERT3U(vdev_count_verify_zaps(spa->spa_root_vdev), ==,
all_vdev_zap_entry_count);
}
#endif

/*
* Rewrite the vdev configuration (which includes the uberblock)
Expand Down

0 comments on commit 7131ef4

Please sign in to comment.