zfs_prop.c revision 8ac09fcebf848c31516b15ce92861de4b2f514e8
20c794b39650d115e17a15983b6b82e46238cf45gavinm * CDDL HEADER START
20c794b39650d115e17a15983b6b82e46238cf45gavinm * The contents of this file are subject to the terms of the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Common Development and Distribution License (the "License").
20c794b39650d115e17a15983b6b82e46238cf45gavinm * You may not use this file except in compliance with the License.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
20c794b39650d115e17a15983b6b82e46238cf45gavinm * See the License for the specific language governing permissions
20c794b39650d115e17a15983b6b82e46238cf45gavinm * and limitations under the License.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * When distributing Covered Code, include this CDDL HEADER in each
20c794b39650d115e17a15983b6b82e46238cf45gavinm * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * If applicable, add the following below this CDDL HEADER, with the
20c794b39650d115e17a15983b6b82e46238cf45gavinm * fields enclosed by brackets "[]" replaced with your own identifying
20c794b39650d115e17a15983b6b82e46238cf45gavinm * information: Portions Copyright [yyyy] [name of copyright owner]
20c794b39650d115e17a15983b6b82e46238cf45gavinm * CDDL HEADER END
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan * Copyright (c) 2011 by Delphix. All rights reserved.
20c794b39650d115e17a15983b6b82e46238cf45gavinm/* Portions Copyright 2010 Robert Milkowski */
074bb90d80fdbeb2d04a8450a55ecbc96de28785Tom Pothier/* Note this is indexed by zfs_userquota_prop_t, keep the order the same */
20c794b39650d115e17a15983b6b82e46238cf45gavinm "userused@",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "userquota@",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "groupused@",
25f476773dea2a0ee593dcf662a38d5f02487196gavinm "groupquota@"
20c794b39650d115e17a15983b6b82e46238cf45gavinm { "sha256,verify",
20c794b39650d115e17a15983b6b82e46238cf45gavinm { "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatability */
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan * Use the unique flags we have to send to u8_strcmp() and/or
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan * u8_textprep() to represent the various normalization property
20c794b39650d115e17a15983b6b82e46238cf45gavinm { "none", 0 },
20c794b39650d115e17a15983b6b82e46238cf45gavinm { "off", 0 },
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* inherit index properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
20c794b39650d115e17a15983b6b82e46238cf45gavinm "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "on | off | lzjb | gzip | gzip-[1-9] | zle", "COMPRESS",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
20c794b39650d115e17a15983b6b82e46238cf45gavinm "discard | groupmask | passthrough", "ACLMODE", acl_mode_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan "discard | noallow | restricted | passthrough | passthrough-x",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
20c794b39650d115e17a15983b6b82e46238cf45gavinm "all | none | metadata", "PRIMARYCACHE", cache_table);
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan zprop_register_index(ZFS_PROP_SECONDARYCACHE, "secondarycache",
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
20c794b39650d115e17a15983b6b82e46238cf45gavinm "all | none | metadata", "SECONDARYCACHE", cache_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY,
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan "latency | throughput", "LOGBIAS", logbias_table);
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan /* inherit index (boolean) properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT,
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_DEVICES, "devices", 1, PROP_INHERIT,
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "DEVICES",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_EXEC, "exec", 1, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "EXEC",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_SETUID, "setuid", 1, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "SETUID",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_READONLY, "readonly", 0, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off", "RDONLY",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_ZONED, "zoned", 0, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM, "on | off", "ZONED", boolean_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_XATTR, "xattr", 1, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "XATTR",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_VSCAN, "vscan", 0, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_NBMAND, "nbmand", 0, PROP_INHERIT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "NBMAND",
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* default index properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_VERSION, "version", 0, PROP_DEFAULT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm "1 | 2 | 3 | 4 | current", "VERSION", version_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_CANMOUNT, "canmount", ZFS_CANMOUNT_ON,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, "on | off | noauto",
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* readonly index (boolean) properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_MOUNTED, "mounted", 0, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM, "yes | no", "MOUNTED", boolean_table);
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_DEFER_DESTROY, "defer_destroy", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_READONLY, ZFS_TYPE_SNAPSHOT, "yes | no", "DEFER_DESTROY",
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* set once index properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_NORMALIZE, "normalization", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_ONETIME, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm "none | formC | formD | formKC | formKD", "NORMALIZATION",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_index(ZFS_PROP_CASE, "casesensitivity",
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_CASE_SENSITIVE, PROP_ONETIME, ZFS_TYPE_FILESYSTEM |
20c794b39650d115e17a15983b6b82e46238cf45gavinm "sensitive | insensitive | mixed", "CASE", case_table);
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan /* set once index (boolean) properties */
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan zprop_register_index(ZFS_PROP_UTF8ONLY, "utf8only", 0, PROP_ONETIME,
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* string properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_string(ZFS_PROP_ORIGIN, "origin", NULL, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<snapshot>", "ORIGIN");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_string(ZFS_PROP_MOUNTPOINT, "mountpoint", "/",
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "<path> | legacy | none",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "MOUNTPOINT");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_string(ZFS_PROP_SHARENFS, "sharenfs", "off",
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | share(1M) options",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "SHARENFS");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_string(ZFS_PROP_TYPE, "type", NULL, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_DATASET, "filesystem | volume | snapshot", "TYPE");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_string(ZFS_PROP_SHARESMB, "sharesmb", "off",
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan "on | off | sharemgr(1M) options", "SHARESMB");
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_MLSLABEL_DEFAULT, PROP_INHERIT, ZFS_TYPE_DATASET,
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* readonly number properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USED, "used", 0, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_AVAILABLE, "available", 0, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "AVAIL");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_REFERENCED, "referenced", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize",
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_VOLUME, "512 to 128k, power of 2", "VOLBLOCK");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USEDSNAP, "usedbysnapshots", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "USEDSNAP");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USEDDS, "usedbydataset", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USEDCHILD, "usedbychildren", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "USEDCHILD");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USEDREFRESERV, "usedbyrefreservation", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY,
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* default number properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_RESERVATION, "reservation", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_VOLSIZE, "volsize", 0, PROP_DEFAULT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_REFQUOTA, "refquota", 0, PROP_DEFAULT,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* inherit number properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize",
20c794b39650d115e17a15983b6b82e46238cf45gavinm ZFS_TYPE_FILESYSTEM, "512 to 128k, power of 2", "RECSIZE");
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* hidden properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions",
20c794b39650d115e17a15983b6b82e46238cf45gavinm PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "STMF_SBD_LU");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_GUID, "guid", PROP_TYPE_NUMBER,
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting",
20c794b39650d115e17a15983b6b82e46238cf45gavinm "USERACCOUNTING");
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER,
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER,
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* oddball properties */
20c794b39650d115e17a15983b6b82e46238cf45gavinm zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0,
20c794b39650d115e17a15983b6b82e46238cf45gavinm /* The mlslabel property is never delegatable. */
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Given a zfs dataset property name, returns the corresponding property ID.
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zprop_name_to_prop(propname, ZFS_TYPE_DATASET));
20c794b39650d115e17a15983b6b82e46238cf45gavinm * For user property names, we allow all lowercase alphanumeric characters, plus
20c794b39650d115e17a15983b6b82e46238cf45gavinm * a few useful punctuation characters.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns true if this is a valid user-defined property (one with a ':').
20c794b39650d115e17a15983b6b82e46238cf45gavinm if (c == ':')
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns true if this is a valid userspace-type property (one with a '@').
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Note that after the @, any character is valid (eg, another @, for SID
a24e89c4a1eec8361718d94a6275e6720643284eKuriakose Kuruvilla * user@domain).
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan for (prop = 0; prop < ZFS_NUM_USERQUOTA_PROPS; prop++) {
a24e89c4a1eec8361718d94a6275e6720643284eKuriakose Kuruvilla if (strncmp(name, zfs_userquota_prop_prefixes[prop],
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan strlen(zfs_userquota_prop_prefixes[prop])) == 0) {
a24e89c4a1eec8361718d94a6275e6720643284eKuriakose Kuruvilla * Tables of index types, plus functions to convert between the user view
a24e89c4a1eec8361718d94a6275e6720643284eKuriakose Kuruvilla * (strings) and internal representation (uint64_t).
20c794b39650d115e17a15983b6b82e46238cf45gavinmzfs_prop_string_to_index(zfs_prop_t prop, const char *string, uint64_t *index)
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zprop_string_to_index(prop, string, index, ZFS_TYPE_DATASET));
20c794b39650d115e17a15983b6b82e46238cf45gavinmzfs_prop_index_to_string(zfs_prop_t prop, uint64_t index, const char **string)
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zprop_index_to_string(prop, index, string, ZFS_TYPE_DATASET));
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zprop_random_value(prop, seed, ZFS_TYPE_DATASET));
8031591d3cc3c82e97f4b60ea22d671525077b15Srihari Venkatesan * Returns TRUE if the property applies to any of the given dataset types.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns TRUE if the property is readonly.
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan zfs_prop_table[prop].pd_attr == PROP_ONETIME);
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns TRUE if the property is only allowed to be set once.
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zfs_prop_table[prop].pd_attr == PROP_ONETIME);
20c794b39650d115e17a15983b6b82e46238cf45gavinmconst char *
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Given a dataset property ID, returns the corresponding name.
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Assuming the zfs dataset property ID is valid.
20c794b39650d115e17a15983b6b82e46238cf45gavinmconst char *
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns TRUE if the property is inheritable.
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns a string describing the set of acceptable values for the given
20c794b39650d115e17a15983b6b82e46238cf45gavinm * zfs property, or NULL if it cannot be set.
a4e4e13f4001644f2f960e3be0056c22b3a40fd1gavinm * Returns TRUE if this property is a string type. Note that index types
a4e4e13f4001644f2f960e3be0056c22b3a40fd1gavinm * (compression, checksum) are treated as strings in userland, even though they
20c794b39650d115e17a15983b6b82e46238cf45gavinm * are stored numerically on disk.
20c794b39650d115e17a15983b6b82e46238cf45gavinm return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
20c794b39650d115e17a15983b6b82e46238cf45gavinm zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns the column header for the given property. Used only in
5667185bc023b9742cb2480659d7673fa9ac8050Srihari Venkatesan * 'zfs list -o', but centralized here with the other property information.
20c794b39650d115e17a15983b6b82e46238cf45gavinmconst char *
20c794b39650d115e17a15983b6b82e46238cf45gavinm * Returns whether the given property should be displayed right-justified for
20c794b39650d115e17a15983b6b82e46238cf45gavinm * 'zfs list'.