588
589 /* visit the MOS */
590 err = traverse_impl(spa, NULL, 0, spa_get_rootblkptr(spa),
591 txg_start, NULL, flags, func, arg);
592 if (err != 0)
593 return (err);
594
595 /* visit each dataset */
596 for (obj = 1; err == 0 || (err != ESRCH && hard);
597 err = dmu_object_next(mos, &obj, FALSE, txg_start)) {
598 dmu_object_info_t doi;
599
600 err = dmu_object_info(mos, obj, &doi);
601 if (err != 0) {
602 if (!hard)
603 return (err);
604 lasterr = err;
605 continue;
606 }
607
608 if (doi.doi_type == DMU_OT_DSL_DATASET) {
609 dsl_dataset_t *ds;
610 uint64_t txg = txg_start;
611
612 dsl_pool_config_enter(dp, FTAG);
613 err = dsl_dataset_hold_obj(dp, obj, FTAG, &ds);
614 dsl_pool_config_exit(dp, FTAG);
615 if (err != 0) {
616 if (!hard)
617 return (err);
618 lasterr = err;
619 continue;
620 }
621 if (ds->ds_phys->ds_prev_snap_txg > txg)
622 txg = ds->ds_phys->ds_prev_snap_txg;
623 err = traverse_dataset(ds, txg, flags, func, arg);
624 dsl_dataset_rele(ds, FTAG);
625 if (err != 0) {
626 if (!hard)
627 return (err);
628 lasterr = err;
|
588
589 /* visit the MOS */
590 err = traverse_impl(spa, NULL, 0, spa_get_rootblkptr(spa),
591 txg_start, NULL, flags, func, arg);
592 if (err != 0)
593 return (err);
594
595 /* visit each dataset */
596 for (obj = 1; err == 0 || (err != ESRCH && hard);
597 err = dmu_object_next(mos, &obj, FALSE, txg_start)) {
598 dmu_object_info_t doi;
599
600 err = dmu_object_info(mos, obj, &doi);
601 if (err != 0) {
602 if (!hard)
603 return (err);
604 lasterr = err;
605 continue;
606 }
607
608 if (doi.doi_bonus_type == DMU_OT_DSL_DATASET) {
609 dsl_dataset_t *ds;
610 uint64_t txg = txg_start;
611
612 dsl_pool_config_enter(dp, FTAG);
613 err = dsl_dataset_hold_obj(dp, obj, FTAG, &ds);
614 dsl_pool_config_exit(dp, FTAG);
615 if (err != 0) {
616 if (!hard)
617 return (err);
618 lasterr = err;
619 continue;
620 }
621 if (ds->ds_phys->ds_prev_snap_txg > txg)
622 txg = ds->ds_phys->ds_prev_snap_txg;
623 err = traverse_dataset(ds, txg, flags, func, arg);
624 dsl_dataset_rele(ds, FTAG);
625 if (err != 0) {
626 if (!hard)
627 return (err);
628 lasterr = err;
|