typedef int (scan_cb_t)(dsl_pool_t *, const blkptr_t *, const zbookmark_t *);
-static scan_cb_t dsl_scan_defrag_cb;
static scan_cb_t dsl_scan_scrub_cb;
-static scan_cb_t dsl_scan_remove_cb;
static dsl_syncfunc_t dsl_scan_cancel_sync;
static void dsl_scan_sync_state(dsl_scan_t *, dmu_tx_t *tx);
if (vdev_resilver_needed(spa->spa_root_vdev,
&scn->scn_phys.scn_min_txg, &scn->scn_phys.scn_max_txg)) {
- spa_event_notify(spa, NULL, ESC_ZFS_RESILVER_START);
+ spa_event_notify(spa, NULL, FM_EREPORT_ZFS_RESILVER_START);
} else {
- spa_event_notify(spa, NULL, ESC_ZFS_SCRUB_START);
+ spa_event_notify(spa, NULL, FM_EREPORT_ZFS_SCRUB_START);
}
spa->spa_scrub_started = B_TRUE;
complete ? scn->scn_phys.scn_max_txg : 0, B_TRUE);
if (complete) {
spa_event_notify(spa, NULL, scn->scn_phys.scn_min_txg ?
- ESC_ZFS_RESILVER_FINISH : ESC_ZFS_SCRUB_FINISH);
+ FM_EREPORT_ZFS_RESILVER_FINISH :
+ FM_EREPORT_ZFS_SCRUB_FINISH);
}
spa_errlog_rotate(spa);
{
dsl_pool_t *dp = scn->scn_dp;
arc_buf_t *buf = NULL;
- blkptr_t bp_toread = *bp;
+ blkptr_t *bp_toread;
+
+ bp_toread = kmem_alloc(sizeof (blkptr_t), KM_SLEEP);
+ *bp_toread = *bp;
/* ASSERT(pbuf == NULL || arc_released(pbuf)); */
if (dsl_scan_check_pause(scn, zb))
- return;
+ goto out;
if (dsl_scan_check_resume(scn, dnp, zb))
- return;
+ goto out;
if (bp->blk_birth == 0)
- return;
+ goto out;
scn->scn_visited_this_txg++;
pbuf, bp);
if (bp->blk_birth <= scn->scn_phys.scn_cur_min_txg)
- return;
+ goto out;
if (BP_GET_TYPE(bp) != DMU_OT_USERGROUP_USED) {
/*
* it (original untranslated -> translations from
* deleted snap -> now).
*/
- bp_toread = *bp;
+ *bp_toread = *bp;
}
- if (dsl_scan_recurse(scn, ds, ostype, dnp, &bp_toread, zb, tx,
+ if (dsl_scan_recurse(scn, ds, ostype, dnp, bp_toread, zb, tx,
&buf) != 0)
- return;
+ goto out;
/*
* If dsl_scan_ddt() has aready visited this block, it will have
if (ddt_class_contains(dp->dp_spa,
scn->scn_phys.scn_ddt_class_max, bp)) {
ASSERT(buf == NULL);
- return;
+ goto out;
}
/*
}
if (buf)
(void) arc_buf_remove_ref(buf, &buf);
+out:
+ kmem_free(bp_toread, sizeof(blkptr_t));
}
static void
dsl_scan_ddt(dsl_scan_t *scn, dmu_tx_t *tx)
{
ddt_bookmark_t *ddb = &scn->scn_phys.scn_ddt_bookmark;
- ddt_entry_t dde = { 0 };
+ ddt_entry_t dde;
int error;
uint64_t n = 0;
+ bzero(&dde, sizeof (ddt_entry_t));
+
while ((error = ddt_walk(scn->scn_dp->dp_spa, ddb, &dde)) == 0) {
ddt_t *ddt;