Don't call sizeof on void
We get the sizeof the appropriate type, and don't cast away const. Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Reviewed-by: Matt Macy <mmacy@FreeBSD.org> Signed-off-by: Paul Dagnelie <pcd@delphix.com> Closes #9455
This commit is contained in:
parent
cdbba101f4
commit
511fce6b1f
@ -126,11 +126,11 @@ rs_get_start_raw(const range_seg_t *rs, const range_tree_t *rt)
|
|||||||
ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES);
|
ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES);
|
||||||
switch (rt->rt_type) {
|
switch (rt->rt_type) {
|
||||||
case RANGE_SEG32:
|
case RANGE_SEG32:
|
||||||
return (((range_seg32_t *)rs)->rs_start);
|
return (((const range_seg32_t *)rs)->rs_start);
|
||||||
case RANGE_SEG64:
|
case RANGE_SEG64:
|
||||||
return (((range_seg64_t *)rs)->rs_start);
|
return (((const range_seg64_t *)rs)->rs_start);
|
||||||
case RANGE_SEG_GAP:
|
case RANGE_SEG_GAP:
|
||||||
return (((range_seg_gap_t *)rs)->rs_start);
|
return (((const range_seg_gap_t *)rs)->rs_start);
|
||||||
default:
|
default:
|
||||||
VERIFY(0);
|
VERIFY(0);
|
||||||
return (0);
|
return (0);
|
||||||
@ -143,11 +143,11 @@ rs_get_end_raw(const range_seg_t *rs, const range_tree_t *rt)
|
|||||||
ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES);
|
ASSERT3U(rt->rt_type, <=, RANGE_SEG_NUM_TYPES);
|
||||||
switch (rt->rt_type) {
|
switch (rt->rt_type) {
|
||||||
case RANGE_SEG32:
|
case RANGE_SEG32:
|
||||||
return (((range_seg32_t *)rs)->rs_end);
|
return (((const range_seg32_t *)rs)->rs_end);
|
||||||
case RANGE_SEG64:
|
case RANGE_SEG64:
|
||||||
return (((range_seg64_t *)rs)->rs_end);
|
return (((const range_seg64_t *)rs)->rs_end);
|
||||||
case RANGE_SEG_GAP:
|
case RANGE_SEG_GAP:
|
||||||
return (((range_seg_gap_t *)rs)->rs_end);
|
return (((const range_seg_gap_t *)rs)->rs_end);
|
||||||
default:
|
default:
|
||||||
VERIFY(0);
|
VERIFY(0);
|
||||||
return (0);
|
return (0);
|
||||||
|
@ -1244,7 +1244,7 @@ dsl_scan_should_clear(dsl_scan_t *scn)
|
|||||||
if (queue != NULL) {
|
if (queue != NULL) {
|
||||||
/* # extents in exts_by_size = # in exts_by_addr */
|
/* # extents in exts_by_size = # in exts_by_addr */
|
||||||
mused += zfs_btree_numnodes(&queue->q_exts_by_size) *
|
mused += zfs_btree_numnodes(&queue->q_exts_by_size) *
|
||||||
sizeof (range_seg_t) + queue->q_sio_memused;
|
sizeof (range_seg_gap_t) + queue->q_sio_memused;
|
||||||
}
|
}
|
||||||
mutex_exit(&tvd->vdev_scan_io_queue_lock);
|
mutex_exit(&tvd->vdev_scan_io_queue_lock);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user