FreeBSD/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c
/*
 * zfs_init_libshare(zhandle, service)
 *
 * Initialize the libshare API if it hasn't already been initialized.
 * In all cases it returns 0 if it succeeded and an error if not. The
 * service value is which part(s) of the API to initialize and is a
 * direct map to the libshare sa_init(service) interface.
 */
zfs_init_libshare(zhandle, service)
Initialize the libshare API if it hasn't already been initialized.
In all cases it returns 0 if it succeeded and an error if not. The
service value is which part(s) of the API to initialize and is a
direct map to the libshare sa_init(service) interface.
zfs_init_libshare ( zhandle service ) Initialize the libshare API if it hasn ' t already been initialized . In all cases it returns 0 if it succeeded and an error if not . The service value is which part ( s ) of the API to initialize and is a direct map to the libshare sa_init ( service ) interface .
int
zfs_init_libshare(libzfs_handle_t *zhandle, int service)
{
	int ret = SA_OK;
#ifdef illumos
	if (_sa_init == NULL)
		ret = SA_CONFIG_ERR;
	if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) {
		zhandle->libzfs_shareflags &= ~ZFSSHARE_MISS;
		if (_sa_needs_refresh != NULL &&
		    _sa_needs_refresh(zhandle->libzfs_sharehdl)) {
			zfs_uninit_libshare(zhandle);
			zhandle->libzfs_sharehdl = _sa_init(service);
		}
	}
	if (ret == SA_OK && zhandle && zhandle->libzfs_sharehdl == NULL)
		zhandle->libzfs_sharehdl = _sa_init(service);
	if (ret == SA_OK && zhandle->libzfs_sharehdl == NULL)
		ret = SA_NO_MEMORY;
#endif
	return (ret);
}
int zfs_init_libshare ( libzfs_handle_t * zhandle , int service ) { int ret = SA_OK ; #ifdef illumos if ( _sa_init == NULL ) ret = SA_CONFIG_ERR ; if ( ret == SA_OK && zhandle -> libzfs_shareflags & ZFSSHARE_MISS ) { zhandle -> libzfs_shareflags &= ~ ZFSSHARE_MISS ; if ( _sa_needs_refresh != NULL && _sa_needs_refresh ( zhandle -> libzfs_sharehdl ) ) { zfs_uninit_libshare ( zhandle ) ; zhandle -> libzfs_sharehdl = _sa_init ( service ) ; } } if ( ret == SA_OK && zhandle && zhandle -> libzfs_sharehdl == NULL ) zhandle -> libzfs_sharehdl = _sa_init ( service ) ; if ( ret == SA_OK && zhandle -> libzfs_sharehdl == NULL ) ret = SA_NO_MEMORY ; #endif return ( ret ) ; }
zfs_init_libshare(zhandle, service)
 Initialize the libshare API if it hasn't already been initialized.
zfs_init_libshare ( zhandle service ) Initialize the libshare API if it hasn ' t already been initialized .
/*
		 * We had a cache miss. Most likely it is a new ZFS
		 * dataset that was just created. We want to make sure
		 * so check timestamps to see if a different process
		 * has updated any of the configuration. If there was
		 * some non-ZFS change, we need to re-initialize the
		 * internal cache.
		 */