git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rebase master to b117
[zfs.git]
/
lib
/
libzfs
/
libzfs_util.c
diff --git
a/lib/libzfs/libzfs_util.c
b/lib/libzfs/libzfs_util.c
index
4270ac5
..
30829d5
100644
(file)
--- a/
lib/libzfs/libzfs_util.c
+++ b/
lib/libzfs/libzfs_util.c
@@
-19,7
+19,7
@@
* CDDL HEADER END
*/
/*
* CDDL HEADER END
*/
/*
- * Copyright 200
8
Sun Microsystems, Inc. All rights reserved.
+ * Copyright 200
9
Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
* Use is subject to license terms.
*/
@@
-210,6
+210,9
@@
libzfs_error_description(libzfs_handle_t *hdl)
case EZFS_ACTIVE_SPARE:
return (dgettext(TEXT_DOMAIN, "pool has active shared spare "
"device"));
case EZFS_ACTIVE_SPARE:
return (dgettext(TEXT_DOMAIN, "pool has active shared spare "
"device"));
+ case EZFS_UNPLAYED_LOGS:
+ return (dgettext(TEXT_DOMAIN, "log device has unplayed intent "
+ "logs"));
case EZFS_UNKNOWN:
return (dgettext(TEXT_DOMAIN, "unknown error"));
default:
case EZFS_UNKNOWN:
return (dgettext(TEXT_DOMAIN, "unknown error"));
default:
@@
-364,6
+367,11
@@
zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
case ENOTSUP:
zfs_verror(hdl, EZFS_BADVERSION, fmt, ap);
break;
case ENOTSUP:
zfs_verror(hdl, EZFS_BADVERSION, fmt, ap);
break;
+ case EAGAIN:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "pool I/O is currently suspended"));
+ zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap);
+ break;
default:
zfs_error_aux(hdl, strerror(errno));
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
default:
zfs_error_aux(hdl, strerror(errno));
zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
@@
-437,6
+445,11
@@
zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
case EDQUOT:
zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
return (-1);
case EDQUOT:
zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
return (-1);
+ case EAGAIN:
+ zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
+ "pool I/O is currently suspended"));
+ zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap);
+ break;
default:
zfs_error_aux(hdl, strerror(error));
default:
zfs_error_aux(hdl, strerror(error));
@@
-480,7
+493,6
@@
zfs_realloc(libzfs_handle_t *hdl, void *ptr, size_t oldsize, size_t newsize)
if ((ret = realloc(ptr, newsize)) == NULL) {
(void) no_memory(hdl);
if ((ret = realloc(ptr, newsize)) == NULL) {
(void) no_memory(hdl);
- free(ptr);
return (NULL);
}
return (NULL);
}
@@
-576,6
+588,7
@@
libzfs_init(void)
zfs_prop_init();
zpool_prop_init();
zfs_prop_init();
zpool_prop_init();
+ libzfs_mnttab_init(hdl);
return (hdl);
}
return (hdl);
}
@@
-593,6
+606,7
@@
libzfs_fini(libzfs_handle_t *hdl)
(void) free(hdl->libzfs_log_str);
zpool_free_handles(hdl);
namespace_clear(hdl);
(void) free(hdl->libzfs_log_str);
zpool_free_handles(hdl);
namespace_clear(hdl);
+ libzfs_mnttab_fini(hdl);
free(hdl);
}
free(hdl);
}
@@
-1018,9
+1032,9
@@
zfs_nicestrtonum(libzfs_handle_t *hdl, const char *value, uint64_t *num)
return (-1);
}
return (-1);
}
- /* Rely on stroll() to process the numeric portion. */
+ /* Rely on stro
u
ll() to process the numeric portion. */
errno = 0;
errno = 0;
- *num = strtoll(value, &end, 10);
+ *num = strto
u
ll(value, &end, 10);
/*
* Check for ERANGE, which indicates that the value is too large to fit
/*
* Check for ERANGE, which indicates that the value is too large to fit
@@
-1210,7
+1224,7
@@
addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
* dataset property,
*/
if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL ||
* dataset property,
*/
if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL ||
-
!zfs_prop_user(propname
))) {
+
(!zfs_prop_user(propname) && !zfs_prop_userquota(propname)
))) {
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid property '%s'"), propname);
return (zfs_error(hdl, EZFS_BADPROP,
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
"invalid property '%s'"), propname);
return (zfs_error(hdl, EZFS_BADPROP,