aboutsummaryrefslogtreecommitdiff
path: root/module/zfs/vdev_removal.c
diff options
context:
space:
mode:
authorSerapheim Dimitropoulos <serapheimd@gmail.com>2019-02-12 18:38:11 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2019-02-12 18:38:11 +0000
commit425d3237ee88abc53d8522a7139c926d278b4b7f (patch)
treeb5ac7302fdc38129013399b1dcb63eb8cf1fddb6 /module/zfs/vdev_removal.c
parentd8d418ff0cc90776182534bce10b01e9487b63e4 (diff)
downloadsrc-425d3237ee88abc53d8522a7139c926d278b4b7f.tar.gz
src-425d3237ee88abc53d8522a7139c926d278b4b7f.zip
Diffstat (limited to 'module/zfs/vdev_removal.c')
-rw-r--r--module/zfs/vdev_removal.c40
1 files changed, 3 insertions, 37 deletions
diff --git a/module/zfs/vdev_removal.c b/module/zfs/vdev_removal.c
index 70620499756c..ff39a0a26d6a 100644
--- a/module/zfs/vdev_removal.c
+++ b/module/zfs/vdev_removal.c
@@ -291,15 +291,8 @@ vdev_remove_initiate_sync(void *arg, dmu_tx_t *tx)
if (ms->ms_sm == NULL)
continue;
- /*
- * Sync tasks happen before metaslab_sync(), therefore
- * smp_alloc and sm_alloc must be the same.
- */
- ASSERT3U(space_map_allocated(ms->ms_sm), ==,
- ms->ms_sm->sm_phys->smp_alloc);
-
spa->spa_removing_phys.sr_to_copy +=
- space_map_allocated(ms->ms_sm);
+ metaslab_allocated_space(ms);
/*
* Space which we are freeing this txg does not need to
@@ -1443,22 +1436,8 @@ spa_vdev_remove_thread(void *arg)
* appropriate action (see free_from_removing_vdev()).
*/
if (msp->ms_sm != NULL) {
- space_map_t *sm = NULL;
-
- /*
- * We have to open a new space map here, because
- * ms_sm's sm_length and sm_alloc may not reflect
- * what's in the object contents, if we are in between
- * metaslab_sync() and metaslab_sync_done().
- */
- VERIFY0(space_map_open(&sm,
- spa->spa_dsl_pool->dp_meta_objset,
- msp->ms_sm->sm_object, msp->ms_sm->sm_start,
- msp->ms_sm->sm_size, msp->ms_sm->sm_shift));
- space_map_update(sm);
- VERIFY0(space_map_load(sm, svr->svr_allocd_segs,
- SM_ALLOC));
- space_map_close(sm);
+ VERIFY0(space_map_load(msp->ms_sm,
+ svr->svr_allocd_segs, SM_ALLOC));
range_tree_walk(msp->ms_freeing,
range_tree_remove, svr->svr_allocd_segs);
@@ -1681,16 +1660,6 @@ spa_vdev_remove_cancel_sync(void *arg, dmu_tx_t *tx)
ASSERT0(range_tree_space(msp->ms_freed));
if (msp->ms_sm != NULL) {
- /*
- * Assert that the in-core spacemap has the same
- * length as the on-disk one, so we can use the
- * existing in-core spacemap to load it from disk.
- */
- ASSERT3U(msp->ms_sm->sm_alloc, ==,
- msp->ms_sm->sm_phys->smp_alloc);
- ASSERT3U(msp->ms_sm->sm_length, ==,
- msp->ms_sm->sm_phys->smp_objsize);
-
mutex_enter(&svr->svr_lock);
VERIFY0(space_map_load(msp->ms_sm,
svr->svr_allocd_segs, SM_ALLOC));
@@ -1789,9 +1758,6 @@ spa_vdev_remove_cancel(spa_t *spa)
return (spa_vdev_remove_cancel_impl(spa));
}
-/*
- * Called every sync pass of every txg if there's a svr.
- */
void
svr_sync(spa_t *spa, dmu_tx_t *tx)
{