Skip to content

Commit 55dd336

Browse files
committed
Fix redundant declaration of dsl_pool_t
Remove redundant dsl_pool variable and duplicate spa_get_dsl() call in vdev_rebuild_thread. Signed-off-by: Akash B <akash-b@hpe.com>
1 parent f3d4c79 commit 55dd336

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

module/zfs/vdev_rebuild.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -764,15 +764,15 @@ vdev_rebuild_thread(void *arg)
764764
spa_t *spa = vd->vdev_spa;
765765
vdev_t *rvd = spa->spa_root_vdev;
766766
int error = 0;
767+
dsl_pool_t *dp = spa_get_dsl(spa);
767768

768769
/*
769770
* If there's a scrub in process request that it be stopped. This
770771
* is not required for a correct rebuild, but we do want rebuilds to
771772
* emulate the resilver behavior as much as possible.
772773
*/
773-
dsl_pool_t *dsl = spa_get_dsl(spa);
774-
if (dsl_scan_scrubbing(dsl))
775-
dsl_scan_cancel(dsl);
774+
if (dsl_scan_scrubbing(dp))
775+
dsl_scan_cancel(dp);
776776

777777
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
778778
mutex_enter(&vd->vdev_rebuild_lock);
@@ -854,7 +854,7 @@ vdev_rebuild_thread(void *arg)
854854
if (zfs_range_tree_space(msp->ms_allocating[j])) {
855855
mutex_exit(&msp->ms_lock);
856856
mutex_exit(&msp->ms_sync_lock);
857-
txg_wait_synced(dsl, 0);
857+
txg_wait_synced(dp, 0);
858858
mutex_enter(&msp->ms_sync_lock);
859859
mutex_enter(&msp->ms_lock);
860860
break;
@@ -931,7 +931,6 @@ vdev_rebuild_thread(void *arg)
931931

932932
spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
933933

934-
dsl_pool_t *dp = spa_get_dsl(spa);
935934
dmu_tx_t *tx = dmu_tx_create_dd(dp->dp_mos_dir);
936935
VERIFY0(dmu_tx_assign(tx, DMU_TX_WAIT | DMU_TX_SUSPEND));
937936

0 commit comments

Comments
 (0)