summaryrefslogtreecommitdiffstats
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-12-05 12:37:00 -0800
committerBrian Behlendorf <[email protected]>2019-12-05 12:37:00 -0800
commit2a8ba608d3eace43010174aa4f67c8b8af4aacf3 (patch)
treeb6393b38c9f31ee69fac7f42414b09ca900f2737 /module/zfs/spa.c
parent12395c7b0bbd2eaaae96d4105bdc83c3d0c73bec (diff)
Replace ASSERTV macro with compiler annotation
Remove the ASSERTV macro and handle suppressing unused compiler warnings for variables only in ASSERTs using the __attribute__((unused)) compiler annotation. The annotation is understood by both gcc and clang. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Jorgen Lundman <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9671
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index bd0090822..6cadefe91 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -847,7 +847,7 @@ spa_prop_clear_bootfs(spa_t *spa, uint64_t dsobj, dmu_tx_t *tx)
static int
spa_change_guid_check(void *arg, dmu_tx_t *tx)
{
- ASSERTV(uint64_t *newguid = arg);
+ uint64_t *newguid __maybe_unused = arg;
spa_t *spa = dmu_tx_pool(tx)->dp_spa;
vdev_t *rvd = spa->spa_root_vdev;
uint64_t vdev_state;
@@ -6530,7 +6530,7 @@ int
spa_vdev_attach(spa_t *spa, uint64_t guid, nvlist_t *nvroot, int replacing)
{
uint64_t txg, dtl_max_txg;
- ASSERTV(vdev_t *rvd = spa->spa_root_vdev);
+ vdev_t *rvd __maybe_unused = spa->spa_root_vdev;
vdev_t *oldvd, *newvd, *newrootvd, *pvd, *tvd;
vdev_ops_t *pvops;
char *oldvdpath, *newvdpath;
@@ -6755,7 +6755,7 @@ spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
{
uint64_t txg;
int error;
- ASSERTV(vdev_t *rvd = spa->spa_root_vdev);
+ vdev_t *rvd __maybe_unused = spa->spa_root_vdev;
vdev_t *vd, *pvd, *cvd, *tvd;
boolean_t unspare = B_FALSE;
uint64_t unspare_guid = 0;
@@ -8640,8 +8640,8 @@ spa_sync_upgrades(spa_t *spa, dmu_tx_t *tx)
static void
vdev_indirect_state_sync_verify(vdev_t *vd)
{
- ASSERTV(vdev_indirect_mapping_t *vim = vd->vdev_indirect_mapping);
- ASSERTV(vdev_indirect_births_t *vib = vd->vdev_indirect_births);
+ vdev_indirect_mapping_t *vim __maybe_unused = vd->vdev_indirect_mapping;
+ vdev_indirect_births_t *vib __maybe_unused = vd->vdev_indirect_births;
if (vd->vdev_ops == &vdev_indirect_ops) {
ASSERT(vim != NULL);