FreeBSD/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c
/*
 * Retrieves a list of enabled features and their refcounts and caches it in
 * the pool handle.
 */
Retrieves a list of enabled features and their refcounts and caches it in
the pool handle.
Retrieves a list of enabled features and their refcounts and caches it in the pool handle .
nvlist_t *
zpool_get_features(zpool_handle_t *zhp)
{
	nvlist_t *config, *features;
	config = zpool_get_config(zhp, NULL);
	if (config == NULL || !nvlist_exists(config,
	    ZPOOL_CONFIG_FEATURE_STATS)) {
		int error;
		boolean_t missing = B_FALSE;
		error = zpool_refresh_stats(zhp, &missing);
		if (error != 0 || missing)
			return (NULL);
		config = zpool_get_config(zhp, NULL);
	}
	if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
	    &features) != 0)
		return (NULL);
	return (features);
}
nvlist_t * zpool_get_features ( zpool_handle_t * zhp ) { nvlist_t * config , * features ; config = zpool_get_config ( zhp , NULL ) ; if ( config == NULL || ! nvlist_exists ( config , ZPOOL_CONFIG_FEATURE_STATS ) ) { int error ; boolean_t missing = B_FALSE ; error = zpool_refresh_stats ( zhp , & missing ) ; if ( error != 0 || missing ) return ( NULL ) ; config = zpool_get_config ( zhp , NULL ) ; } if ( nvlist_lookup_nvlist ( config , ZPOOL_CONFIG_FEATURE_STATS , & features ) != 0 ) return ( NULL ) ; return ( features ) ; }
Retrieves a list of enabled features and their refcounts and caches it in
 the pool handle.
Retrieves a list of enabled features and their refcounts and caches it in the pool handle .