FreeBSD/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c
/*
 * Get scan stats for zpool status reports
 */
Get scan stats for zpool status reports
Get scan stats for zpool status reports
int
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;
	if (scn == NULL || scn->scn_phys.scn_func == POOL_SCAN_NONE)
		return (SET_ERROR(ENOENT));
	bzero(ps, sizeof (pool_scan_stat_t));
	ps->pss_func = scn->scn_phys.scn_func;
	ps->pss_start_time = scn->scn_phys.scn_start_time;
	ps->pss_end_time = scn->scn_phys.scn_end_time;
	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_processed = scn->scn_phys.scn_processed;
	ps->pss_errors = scn->scn_phys.scn_errors;
	ps->pss_state = scn->scn_phys.scn_state;
	ps->pss_pass_start = spa->spa_scan_pass_start;
	ps->pss_pass_exam = spa->spa_scan_pass_exam;
	return (0);
}
int 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 ; if ( scn == NULL || scn -> scn_phys . scn_func == POOL_SCAN_NONE ) return ( SET_ERROR ( ENOENT ) ) ; bzero ( ps , sizeof ( pool_scan_stat_t ) ) ; ps -> pss_func = scn -> scn_phys . scn_func ; ps -> pss_start_time = scn -> scn_phys . scn_start_time ; ps -> pss_end_time = scn -> scn_phys . scn_end_time ; 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_processed = scn -> scn_phys . scn_processed ; ps -> pss_errors = scn -> scn_phys . scn_errors ; ps -> pss_state = scn -> scn_phys . scn_state ; ps -> pss_pass_start = spa -> spa_scan_pass_start ; ps -> pss_pass_exam = spa -> spa_scan_pass_exam ; return ( 0 ) ; }
Get scan stats for zpool status reports
Get scan stats for zpool status reports
/* data stored on disk */ /* data not stored on disk */