16 * fields enclosed by brackets "[]" replaced with your own identifying |
16 * fields enclosed by brackets "[]" replaced with your own identifying |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
|
21 |
21 /* |
22 /* |
22 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. |
23 * Copyright (c) 2011 by Delphix. All rights reserved. |
24 * Copyright (c) 2012 by Delphix. All rights reserved. |
24 */ |
25 */ |
25 |
26 |
26 /* |
27 /* |
27 * Internal utility routines for the ZFS library. |
28 * Internal utility routines for the ZFS library. |
28 */ |
29 */ |
110 case EZFS_NOREPLICAS: |
112 case EZFS_NOREPLICAS: |
111 return (dgettext(TEXT_DOMAIN, "no valid replicas")); |
113 return (dgettext(TEXT_DOMAIN, "no valid replicas")); |
112 case EZFS_RESILVERING: |
114 case EZFS_RESILVERING: |
113 return (dgettext(TEXT_DOMAIN, "currently resilvering")); |
115 return (dgettext(TEXT_DOMAIN, "currently resilvering")); |
114 case EZFS_BADVERSION: |
116 case EZFS_BADVERSION: |
115 return (dgettext(TEXT_DOMAIN, "unsupported version")); |
117 return (dgettext(TEXT_DOMAIN, "unsupported version or " |
|
118 "feature")); |
116 case EZFS_POOLUNAVAIL: |
119 case EZFS_POOLUNAVAIL: |
117 return (dgettext(TEXT_DOMAIN, "pool is unavailable")); |
120 return (dgettext(TEXT_DOMAIN, "pool is unavailable")); |
118 case EZFS_DEVOVERFLOW: |
121 case EZFS_DEVOVERFLOW: |
119 return (dgettext(TEXT_DOMAIN, "too many devices in one vdev")); |
122 return (dgettext(TEXT_DOMAIN, "too many devices in one vdev")); |
120 case EZFS_BADPATH: |
123 case EZFS_BADPATH: |
1280 /* |
1284 /* |
1281 * When no property table entry can be found, return failure if |
1285 * When no property table entry can be found, return failure if |
1282 * this is a pool property or if this isn't a user-defined |
1286 * this is a pool property or if this isn't a user-defined |
1283 * dataset property, |
1287 * dataset property, |
1284 */ |
1288 */ |
1285 if (prop == ZPROP_INVAL && (type == ZFS_TYPE_POOL || |
1289 if (prop == ZPROP_INVAL && ((type == ZFS_TYPE_POOL && |
1286 (!zfs_prop_user(propname) && !zfs_prop_userquota(propname) && |
1290 !zpool_prop_feature(propname) && |
1287 !zfs_prop_written(propname)))) { |
1291 !zpool_prop_unsupported(propname)) || |
|
1292 (type == ZFS_TYPE_DATASET && !zfs_prop_user(propname) && |
|
1293 !zfs_prop_userquota(propname) && !zfs_prop_written(propname)))) { |
1288 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, |
1294 zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, |
1289 "invalid property '%s'"), propname); |
1295 "invalid property '%s'"), propname); |
1290 return (zfs_error(hdl, EZFS_BADPROP, |
1296 return (zfs_error(hdl, EZFS_BADPROP, |
1291 dgettext(TEXT_DOMAIN, "bad property list"))); |
1297 dgettext(TEXT_DOMAIN, "bad property list"))); |
1292 } |
1298 } |
1294 if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL) |
1300 if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL) |
1295 return (-1); |
1301 return (-1); |
1296 |
1302 |
1297 entry->pl_prop = prop; |
1303 entry->pl_prop = prop; |
1298 if (prop == ZPROP_INVAL) { |
1304 if (prop == ZPROP_INVAL) { |
1299 if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == NULL) { |
1305 if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) == |
|
1306 NULL) { |
1300 free(entry); |
1307 free(entry); |
1301 return (-1); |
1308 return (-1); |
1302 } |
1309 } |
1303 entry->pl_width = strlen(propname); |
1310 entry->pl_width = strlen(propname); |
1304 } else { |
1311 } else { |