From df72b8bebe0ebac0b20e0750984bad182cb6564a Mon Sep 17 00:00:00 2001 From: Serapheim Dimitropoulos Date: Fri, 25 Jan 2019 09:51:24 -0800 Subject: Rename range_tree_verify to range_tree_verify_not_present The range_tree_verify function looks for a segment in a range tree and panics if the segment is present on the tree. This patch gives the function a more descriptive name. Reviewed-by: Matt Ahrens Reviewed-by: George Melikov Reviewed-by: Brian Behlendorf Signed-off-by: Serapheim Dimitropoulos Closes #8327 --- module/zfs/metaslab.c | 14 ++++++++------ module/zfs/range_tree.c | 8 +++----- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'module/zfs') diff --git a/module/zfs/metaslab.c b/module/zfs/metaslab.c index 20e7f0ed3..aeca0ed20 100644 --- a/module/zfs/metaslab.c +++ b/module/zfs/metaslab.c @@ -4256,14 +4256,16 @@ metaslab_check_free_impl(vdev_t *vd, uint64_t offset, uint64_t size) msp = vd->vdev_ms[offset >> vd->vdev_ms_shift]; mutex_enter(&msp->ms_lock); - if (msp->ms_loaded) - range_tree_verify(msp->ms_allocatable, offset, size); + if (msp->ms_loaded) { + range_tree_verify_not_present(msp->ms_allocatable, + offset, size); + } - range_tree_verify(msp->ms_freeing, offset, size); - range_tree_verify(msp->ms_checkpointing, offset, size); - range_tree_verify(msp->ms_freed, offset, size); + range_tree_verify_not_present(msp->ms_freeing, offset, size); + range_tree_verify_not_present(msp->ms_checkpointing, offset, size); + range_tree_verify_not_present(msp->ms_freed, offset, size); for (int j = 0; j < TXG_DEFER_SIZE; j++) - range_tree_verify(msp->ms_defer[j], offset, size); + range_tree_verify_not_present(msp->ms_defer[j], offset, size); mutex_exit(&msp->ms_lock); } diff --git a/module/zfs/range_tree.c b/module/zfs/range_tree.c index 2181a92df..1a31c1129 100644 --- a/module/zfs/range_tree.c +++ b/module/zfs/range_tree.c @@ -511,13 +511,11 @@ range_tree_find(range_tree_t *rt, uint64_t start, uint64_t size) } void -range_tree_verify(range_tree_t *rt, uint64_t off, uint64_t size) +range_tree_verify_not_present(range_tree_t *rt, uint64_t off, uint64_t size) { - range_seg_t *rs; - - rs = range_tree_find(rt, off, size); + range_seg_t *rs = range_tree_find(rt, off, size); if (rs != NULL) - panic("freeing free block; rs=%p", (void *)rs); + panic("segment already in tree; rs=%p", (void *)rs); } boolean_t -- cgit v1.2.3