libzfs_util.c revision ca45db4129beff691dc46576c328149443788af2
694N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
#include <errno.h>
#include <fcntl.h>
#include <libintl.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <unistd.h>
#include <ctype.h>
#include <math.h>
#include <libzfs.h>
#include "libzfs_impl.h"
#include "zfs_prop.h"
case EZFS_NOMEM:
case EZFS_BADPROP:
case EZFS_PROPREADONLY:
case EZFS_PROPTYPE:
case EZFS_PROPNONINHERIT:
case EZFS_PROPSPACE:
case EZFS_BADTYPE:
case EZFS_BUSY:
case EZFS_EXISTS:
case EZFS_NOENT:
case EZFS_BADSTREAM:
case EZFS_DSREADONLY:
case EZFS_VOLTOOBIG:
case EZFS_VOLHASDATA:
case EZFS_INVALIDNAME:
case EZFS_BADRESTORE:
case EZFS_BADBACKUP:
case EZFS_BADTARGET:
case EZFS_NODEVICE:
case EZFS_BADDEV:
case EZFS_NOREPLICAS:
case EZFS_RESILVERING:
case EZFS_BADVERSION:
case EZFS_POOLUNAVAIL:
case EZFS_DEVOVERFLOW:
case EZFS_BADPATH:
case EZFS_CROSSTARGET:
case EZFS_ZONED:
case EZFS_MOUNTFAILED:
case EZFS_UMOUNTFAILED:
case EZFS_UNSHARENFSFAILED:
case EZFS_SHARENFSFAILED:
case EZFS_UNSHARESMBFAILED:
case EZFS_SHARESMBFAILED:
case EZFS_ISCSISVCUNAVAIL:
case EZFS_DEVLINKS:
case EZFS_PERM:
case EZFS_NOSPC:
case EZFS_IO:
case EZFS_INTR:
case EZFS_ISSPARE:
case EZFS_INVALCONFIG:
case EZFS_RECURSIVE:
case EZFS_NOHISTORY:
case EZFS_UNSHAREISCSIFAILED:
case EZFS_SHAREISCSIFAILED:
case EZFS_POOLPROPS:
case EZFS_POOL_NOTSUP:
case EZFS_POOL_INVALARG:
case EZFS_NAMETOOLONG:
case EZFS_OPENFAILED:
case EZFS_NOCAP:
case EZFS_LABELFAILED:
case EZFS_BADWHO:
case EZFS_BADPERM:
case EZFS_BADPERMSET:
case EZFS_NODELEGATION:
case EZFS_PERMRDONLY:
case EZFS_BADCACHE:
case EZFS_ISL2CACHE:
case EZFS_VDEVNOTSUP:
case EZFS_NOTSUP:
case EZFS_ACTIVE_SPARE:
case EZFS_UNPLAYED_LOGS:
case EZFS_REFTAG_RELE:
case EZFS_REFTAG_HOLD:
case EZFS_TAGTOOLONG:
case EZFS_UNKNOWN:
abort();
switch (error) {
case EPERM:
case EACCES:
case ECANCELED:
case EIO:
case EINTR:
switch (error) {
case ENXIO:
case ENODEV:
case ENOENT:
case ENOSPC:
case EDQUOT:
case EEXIST:
case EBUSY:
case EROFS:
case ENAMETOOLONG:
case ENOTSUP:
case EAGAIN:
switch (error) {
case ENODEV:
case ENOENT:
case EEXIST:
case EBUSY:
case ENXIO:
case ENAMETOOLONG:
case ENOTSUP:
case EINVAL:
case ENOSPC:
case EDQUOT:
case EAGAIN:
void *data;
return (data);
void *ret;
return (NULL);
return (ret);
char *ret;
return (ret);
int index = 0;
index++;
if (index == 0) {
libzfs_init(void)
return (NULL);
return (NULL);
return (NULL);
return (hdl);
int ret;
return (NULL);
if (ret != 0) {
return (NULL);
path);
return (NULL);
if (len == 0)
== NULL)
char *packed;
int error;
return (error);
char *title;
ZFS_PROP_NAME) &&
case GET_COL_NAME:
case GET_COL_PROPERTY:
case GET_COL_VALUE:
case GET_COL_SOURCE:
title);
const char *source)
const char *str;
case GET_COL_NAME:
case GET_COL_PROPERTY:
case GET_COL_VALUE:
case GET_COL_SOURCE:
switch (sourcetype) {
case ZPROP_SRC_NONE:
case ZPROP_SRC_DEFAULT:
case ZPROP_SRC_LOCAL:
case ZPROP_SRC_TEMPORARY:
case ZPROP_SRC_INHERITED:
str);
char *end;
int shift;
*num = 0;
if (hdl)
errno = 0;
if (hdl)
if (hdl)
if (hdl)
const char *errbuf)
const char *propname;
char *value;
*ivalp = 0;
switch (proptype) {
case PROP_TYPE_STRING:
goto error;
goto error;
case PROP_TYPE_NUMBER:
goto error;
goto error;
goto error;
case PROP_TYPE_INDEX:
goto error;
goto error;
abort();
int prop;
type);
if (len == 0) {
static char *spaceprops[] = {
for (i = 0; spaceprops[i]; i++) {
props = p;
props++;
typedef struct expand_data {
return (ZPROP_INVAL);
return (ZPROP_CONT);