aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/vdev_indirect_mapping.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/vdev_indirect_mapping.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/vdev_indirect_mapping.c')
-rw-r--r--module/zfs/vdev_indirect_mapping.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/module/zfs/vdev_indirect_mapping.c b/module/zfs/vdev_indirect_mapping.c
index e4d998f09..bb484a401 100644
--- a/module/zfs/vdev_indirect_mapping.c
+++ b/module/zfs/vdev_indirect_mapping.c
@@ -39,11 +39,12 @@ vdev_indirect_mapping_verify(vdev_indirect_mapping_t *vim)
EQUIV(vim->vim_phys->vimp_num_entries > 0,
vim->vim_entries != NULL);
if (vim->vim_phys->vimp_num_entries > 0) {
- ASSERTV(vdev_indirect_mapping_entry_phys_t *last_entry =
- &vim->vim_entries[vim->vim_phys->vimp_num_entries - 1]);
- ASSERTV(uint64_t offset =
- DVA_MAPPING_GET_SRC_OFFSET(last_entry));
- ASSERTV(uint64_t size = DVA_GET_ASIZE(&last_entry->vimep_dst));
+ vdev_indirect_mapping_entry_phys_t *last_entry __maybe_unused =
+ &vim->vim_entries[vim->vim_phys->vimp_num_entries - 1];
+ uint64_t offset __maybe_unused =
+ DVA_MAPPING_GET_SRC_OFFSET(last_entry);
+ uint64_t size __maybe_unused =
+ DVA_GET_ASIZE(&last_entry->vimep_dst);
ASSERT3U(vim->vim_phys->vimp_max_offset, >=, offset + size);
}