FreeBSD/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c
/*
 * Print log vdevs.
 * Logs are recorded as top level vdevs in the main pool child array
 * but with "is_log" set to 1. We use either print_status_config() or
 * print_import_config() to print the top level logs then any log
 * children (eg mirrored slogs) are printed recursively - which
 * works because only the top level vdev is marked "is_log"
 */
Print log vdevs.
Logs are recorded as top level vdevs in the main pool child array
but with "is_log" set to 1. We use either print_status_config() or
print_import_config() to print the top level logs then any log
children  are printed recursively - which
works because only the top level vdev is marked "is_log"
Print log vdevs . Logs are recorded as top level vdevs in the main pool child array but with " is_log " set to 1 . We use either print_status_config () or print_import_config () to print the top level logs then any log children are printed recursively - which works because only the top level vdev is marked " is_log "
static void
print_logs(zpool_handle_t *zhp, nvlist_t *nv, int namewidth, boolean_t verbose)
{
	uint_t c, children;
	nvlist_t **child;
	if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, &child,
	    &children) != 0)
		return;
	(void) printf(gettext("\tlogs\n"));
	for (c = 0; c < children; c++) {
		uint64_t is_log = B_FALSE;
		char *name;
		(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
		    &is_log);
		if (!is_log)
			continue;
		name = zpool_vdev_name(g_zfs, zhp, child[c], B_TRUE);
		if (verbose)
			print_status_config(zhp, name, child[c], namewidth,
			    2, B_FALSE);
		else
			print_import_config(name, child[c], namewidth, 2);
		free(name);
	}
}
static void print_logs ( zpool_handle_t * zhp , nvlist_t * nv , int namewidth , boolean_t verbose ) { uint_t c , children ; nvlist_t * * child ; if ( nvlist_lookup_nvlist_array ( nv , ZPOOL_CONFIG_CHILDREN , & child , & children ) != 0 ) return ; ( void ) printf ( gettext ( " \t \n " ) ) ; for ( c = 0 ; c < children ; c ++ ) { uint64_t is_log = B_FALSE ; char * name ; ( void ) nvlist_lookup_uint64 ( child [ c ] , ZPOOL_CONFIG_IS_LOG , & is_log ) ; if ( ! is_log ) continue ; name = zpool_vdev_name ( g_zfs , zhp , child [ c ] , B_TRUE ) ; if ( verbose ) print_status_config ( zhp , name , child [ c ] , namewidth , 2 , B_FALSE ) ; else print_import_config ( name , child [ c ] , namewidth , 2 ) ; free ( name ) ; } }
Print log vdevs.
Print log vdevs .