aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-01-19 17:09:04 -0800
committerGitHub <[email protected]>2017-01-19 17:09:04 -0800
commitbeabc5e46c7bbe4f1ab3f6ed7b92dc9a7a314c99 (patch)
tree16942f7c4559cc19a083badf18aa5f7793f7c787
parent040dab993936d832df4c7624bbcdb71c3fb9b34b (diff)
Fix unused variable warning
The local mg variable is unused in non-debug builds. Wrap the variable in ASSERTV() so that it's only present in the debug build. Introduced by OpenZFS 7303. Reviewed-by: Don Brady <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #5616
-rw-r--r--cmd/zdb/zdb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c
index 7f5de16aa..f7d3dbb8b 100644
--- a/cmd/zdb/zdb.c
+++ b/cmd/zdb/zdb.c
@@ -2654,7 +2654,7 @@ zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *vd = rvd->vdev_child[c];
- metaslab_group_t *mg = vd->vdev_mg;
+ ASSERTV(metaslab_group_t *mg = vd->vdev_mg);
for (m = 0; m < vd->vdev_ms_count; m++) {
metaslab_t *msp = vd->vdev_ms[m];
ASSERT3P(msp->ms_group, ==, mg);
@@ -2713,7 +2713,7 @@ zdb_leak_fini(spa_t *spa)
vdev_t *rvd = spa->spa_root_vdev;
for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *vd = rvd->vdev_child[c];
- metaslab_group_t *mg = vd->vdev_mg;
+ ASSERTV(metaslab_group_t *mg = vd->vdev_mg);
for (m = 0; m < vd->vdev_ms_count; m++) {
metaslab_t *msp = vd->vdev_ms[m];
ASSERT3P(mg, ==, msp->ms_group);