Changeset View
Changeset View
Standalone View
Standalone View
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
Show First 20 Lines • Show All 2,089 Lines • ▼ Show 20 Lines | #endif /* illumos */ | ||||
zil_init(); | zil_init(); | ||||
vdev_cache_stat_init(); | vdev_cache_stat_init(); | ||||
vdev_file_init(); | vdev_file_init(); | ||||
zfs_prop_init(); | zfs_prop_init(); | ||||
zpool_prop_init(); | zpool_prop_init(); | ||||
zpool_feature_init(); | zpool_feature_init(); | ||||
spa_config_load(); | spa_config_load(); | ||||
l2arc_start(); | l2arc_start(); | ||||
scan_init(); | |||||
dsl_scan_global_init(); | |||||
#ifndef illumos | #ifndef illumos | ||||
#ifdef _KERNEL | #ifdef _KERNEL | ||||
zfs_deadman_init(); | zfs_deadman_init(); | ||||
#endif | #endif | ||||
#endif /* !illumos */ | #endif /* !illumos */ | ||||
} | } | ||||
void | void | ||||
spa_fini(void) | spa_fini(void) | ||||
{ | { | ||||
l2arc_stop(); | l2arc_stop(); | ||||
spa_evict_all(); | spa_evict_all(); | ||||
vdev_file_fini(); | vdev_file_fini(); | ||||
vdev_cache_stat_fini(); | vdev_cache_stat_fini(); | ||||
zil_fini(); | zil_fini(); | ||||
dmu_fini(); | dmu_fini(); | ||||
lz4_fini(); | lz4_fini(); | ||||
zio_fini(); | zio_fini(); | ||||
metaslab_alloc_trace_fini(); | metaslab_alloc_trace_fini(); | ||||
range_tree_fini(); | range_tree_fini(); | ||||
unique_fini(); | unique_fini(); | ||||
refcount_fini(); | refcount_fini(); | ||||
scan_fini(); | |||||
avl_destroy(&spa_namespace_avl); | avl_destroy(&spa_namespace_avl); | ||||
avl_destroy(&spa_spare_avl); | avl_destroy(&spa_spare_avl); | ||||
avl_destroy(&spa_l2cache_avl); | avl_destroy(&spa_l2cache_avl); | ||||
cv_destroy(&spa_namespace_cv); | cv_destroy(&spa_namespace_cv); | ||||
mutex_destroy(&spa_namespace_lock); | mutex_destroy(&spa_namespace_lock); | ||||
mutex_destroy(&spa_spare_lock); | mutex_destroy(&spa_spare_lock); | ||||
mutex_destroy(&spa_l2cache_lock); | mutex_destroy(&spa_l2cache_lock); | ||||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | spa_scan_stat_init(spa_t *spa) | ||||
/* data not stored on disk */ | /* data not stored on disk */ | ||||
spa->spa_scan_pass_start = gethrestime_sec(); | spa->spa_scan_pass_start = gethrestime_sec(); | ||||
if (dsl_scan_is_paused_scrub(spa->spa_dsl_pool->dp_scan)) | if (dsl_scan_is_paused_scrub(spa->spa_dsl_pool->dp_scan)) | ||||
spa->spa_scan_pass_scrub_pause = spa->spa_scan_pass_start; | spa->spa_scan_pass_scrub_pause = spa->spa_scan_pass_start; | ||||
else | else | ||||
spa->spa_scan_pass_scrub_pause = 0; | spa->spa_scan_pass_scrub_pause = 0; | ||||
spa->spa_scan_pass_scrub_spent_paused = 0; | spa->spa_scan_pass_scrub_spent_paused = 0; | ||||
spa->spa_scan_pass_exam = 0; | spa->spa_scan_pass_exam = 0; | ||||
spa->spa_scan_pass_issued = 0; | |||||
vdev_scan_stat_init(spa->spa_root_vdev); | vdev_scan_stat_init(spa->spa_root_vdev); | ||||
} | } | ||||
/* | /* | ||||
* Get scan stats for zpool status reports | * Get scan stats for zpool status reports | ||||
*/ | */ | ||||
int | int | ||||
spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps) | spa_scan_get_stats(spa_t *spa, pool_scan_stat_t *ps) | ||||
{ | { | ||||
dsl_scan_t *scn = spa->spa_dsl_pool ? spa->spa_dsl_pool->dp_scan : NULL; | dsl_scan_t *scn = spa->spa_dsl_pool ? spa->spa_dsl_pool->dp_scan : NULL; | ||||
if (scn == NULL || scn->scn_phys.scn_func == POOL_SCAN_NONE) | if (scn == NULL || scn->scn_phys.scn_func == POOL_SCAN_NONE) | ||||
return (SET_ERROR(ENOENT)); | return (SET_ERROR(ENOENT)); | ||||
bzero(ps, sizeof (pool_scan_stat_t)); | bzero(ps, sizeof (pool_scan_stat_t)); | ||||
/* data stored on disk */ | /* data stored on disk */ | ||||
ps->pss_func = scn->scn_phys.scn_func; | ps->pss_func = scn->scn_phys.scn_func; | ||||
ps->pss_state = scn->scn_phys.scn_state; | |||||
ps->pss_start_time = scn->scn_phys.scn_start_time; | ps->pss_start_time = scn->scn_phys.scn_start_time; | ||||
ps->pss_end_time = scn->scn_phys.scn_end_time; | ps->pss_end_time = scn->scn_phys.scn_end_time; | ||||
ps->pss_to_examine = scn->scn_phys.scn_to_examine; | ps->pss_to_examine = scn->scn_phys.scn_to_examine; | ||||
ps->pss_examined = scn->scn_phys.scn_examined; | |||||
ps->pss_to_process = scn->scn_phys.scn_to_process; | ps->pss_to_process = scn->scn_phys.scn_to_process; | ||||
ps->pss_processed = scn->scn_phys.scn_processed; | ps->pss_processed = scn->scn_phys.scn_processed; | ||||
ps->pss_errors = scn->scn_phys.scn_errors; | ps->pss_errors = scn->scn_phys.scn_errors; | ||||
ps->pss_state = scn->scn_phys.scn_state; | ps->pss_examined = scn->scn_phys.scn_examined; | ||||
ps->pss_issued = | |||||
scn->scn_issued_before_pass + spa->spa_scan_pass_issued; | |||||
/* data not stored on disk */ | /* data not stored on disk */ | ||||
ps->pss_pass_start = spa->spa_scan_pass_start; | ps->pss_pass_start = spa->spa_scan_pass_start; | ||||
ps->pss_pass_exam = spa->spa_scan_pass_exam; | ps->pss_pass_exam = spa->spa_scan_pass_exam; | ||||
ps->pss_pass_issued = spa->spa_scan_pass_issued; | |||||
ps->pss_pass_scrub_pause = spa->spa_scan_pass_scrub_pause; | ps->pss_pass_scrub_pause = spa->spa_scan_pass_scrub_pause; | ||||
ps->pss_pass_scrub_spent_paused = spa->spa_scan_pass_scrub_spent_paused; | ps->pss_pass_scrub_spent_paused = spa->spa_scan_pass_scrub_spent_paused; | ||||
return (0); | return (0); | ||||
} | } | ||||
boolean_t | boolean_t | ||||
spa_debug_enabled(spa_t *spa) | spa_debug_enabled(spa_t *spa) | ||||
▲ Show 20 Lines • Show All 129 Lines • Show Last 20 Lines |