usr/src/common/zfs/zfs_prop.c
author Mark J Musante <Mark.Musante@Sun.COM>
Mon, 03 May 2010 09:07:08 -0600
changeset 12294 2a74b443e6b1
parent 12164 0eb8d6741e37
child 13370 8c04143bd318
permissions -rw-r--r--
PSARC/2010/108 zil synchronicity 6280630 zil synchronicity Contributed by Robert Milkowski <[email protected]>
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     1
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     2
 * CDDL HEADER START
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     3
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
1638
52000886673f 6399899 change the default value of snapdir property to "hidden"
lling
parents: 1356
diff changeset
     5
 * Common Development and Distribution License (the "License").
52000886673f 6399899 change the default value of snapdir property to "hidden"
lling
parents: 1356
diff changeset
     6
 * You may not use this file except in compliance with the License.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     7
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    11
 * and limitations under the License.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    12
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    18
 *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    19
 * CDDL HEADER END
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    20
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    21
/*
12164
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
    22
 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    23
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    24
12294
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
    25
/* Portions Copyright 2010 Robert Milkowski */
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
    26
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    27
#include <sys/zio.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    28
#include <sys/spa.h>
5498
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
    29
#include <sys/u8_textprep.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    30
#include <sys/zfs_acl.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    31
#include <sys/zfs_ioctl.h>
4577
ed36b0e652bc PSARC/2007/328 zfs upgrade
ahrens
parents: 4543
diff changeset
    32
#include <sys/zfs_znode.h>
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    33
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    34
#include "zfs_prop.h"
4543
12bb2876a62e PSARC/2006/465 ZFS Delegated Administration
marks
parents: 4451
diff changeset
    35
#include "zfs_deleg.h"
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    36
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    37
#if defined(_KERNEL)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    38
#include <sys/systm.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    39
#else
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    40
#include <stdlib.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    41
#include <string.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    42
#include <ctype.h>
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    43
#endif
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
    44
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    45
static zprop_desc_t zfs_prop_table[ZFS_NUM_PROPS];
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    46
9396
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    47
/* Note this is indexed by zfs_userquota_prop_t, keep the order the same */
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    48
const char *zfs_userquota_prop_prefixes[] = {
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    49
	"userused@",
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    50
	"userquota@",
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    51
	"groupused@",
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    52
	"groupquota@"
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    53
};
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
    54
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    55
zprop_desc_t *
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    56
zfs_prop_get_table(void)
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    57
{
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    58
	return (zfs_prop_table);
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    59
}
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    60
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    61
void
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    62
zfs_prop_init(void)
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    63
{
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    64
	static zprop_index_t checksum_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    65
		{ "on",		ZIO_CHECKSUM_ON },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    66
		{ "off",	ZIO_CHECKSUM_OFF },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    67
		{ "fletcher2",	ZIO_CHECKSUM_FLETCHER_2 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    68
		{ "fletcher4",	ZIO_CHECKSUM_FLETCHER_4 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    69
		{ "sha256",	ZIO_CHECKSUM_SHA256 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    70
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    71
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    72
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    73
	static zprop_index_t dedup_table[] = {
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    74
		{ "on",		ZIO_CHECKSUM_ON },
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    75
		{ "off",	ZIO_CHECKSUM_OFF },
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    76
		{ "verify",	ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    77
		{ "sha256",	ZIO_CHECKSUM_SHA256 },
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    78
		{ "sha256,verify",
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    79
				ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY },
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    80
		{ NULL }
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    81
	};
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    82
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
    83
	static zprop_index_t compress_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    84
		{ "on",		ZIO_COMPRESS_ON },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    85
		{ "off",	ZIO_COMPRESS_OFF },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    86
		{ "lzjb",	ZIO_COMPRESS_LZJB },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    87
		{ "gzip",	ZIO_COMPRESS_GZIP_6 },	/* gzip default */
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    88
		{ "gzip-1",	ZIO_COMPRESS_GZIP_1 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    89
		{ "gzip-2",	ZIO_COMPRESS_GZIP_2 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    90
		{ "gzip-3",	ZIO_COMPRESS_GZIP_3 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    91
		{ "gzip-4",	ZIO_COMPRESS_GZIP_4 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    92
		{ "gzip-5",	ZIO_COMPRESS_GZIP_5 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    93
		{ "gzip-6",	ZIO_COMPRESS_GZIP_6 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    94
		{ "gzip-7",	ZIO_COMPRESS_GZIP_7 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    95
		{ "gzip-8",	ZIO_COMPRESS_GZIP_8 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    96
		{ "gzip-9",	ZIO_COMPRESS_GZIP_9 },
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
    97
		{ "zle",	ZIO_COMPRESS_ZLE },
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    98
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
    99
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   100
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   101
	static zprop_index_t snapdir_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   102
		{ "hidden",	ZFS_SNAPDIR_HIDDEN },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   103
		{ "visible",	ZFS_SNAPDIR_VISIBLE },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   104
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   105
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   106
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   107
	static zprop_index_t acl_inherit_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   108
		{ "discard",	ZFS_ACL_DISCARD },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   109
		{ "noallow",	ZFS_ACL_NOALLOW },
6385
5437941ec5a1 PSARC/2008/231 New ZFS "passthrough" ACL inheritance rules
marks
parents: 6168
diff changeset
   110
		{ "restricted",	ZFS_ACL_RESTRICTED },
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   111
		{ "passthrough", ZFS_ACL_PASSTHROUGH },
6385
5437941ec5a1 PSARC/2008/231 New ZFS "passthrough" ACL inheritance rules
marks
parents: 6168
diff changeset
   112
		{ "secure",	ZFS_ACL_RESTRICTED }, /* bkwrd compatability */
8053
271f44d3de11 PSARC/2008/659 New ZFS "passthrough-x" ACL inheritance rules
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 7390
diff changeset
   113
		{ "passthrough-x", ZFS_ACL_PASSTHROUGH_X },
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   114
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   115
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   116
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   117
	static zprop_index_t case_table[] = {
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   118
		{ "sensitive",		ZFS_CASE_SENSITIVE },
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   119
		{ "insensitive",	ZFS_CASE_INSENSITIVE },
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   120
		{ "mixed",		ZFS_CASE_MIXED },
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   121
		{ NULL }
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   122
	};
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   123
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   124
	static zprop_index_t copies_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   125
		{ "1",		1 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   126
		{ "2",		2 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   127
		{ "3",		3 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   128
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   129
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   130
5498
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   131
	/*
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   132
	 * Use the unique flags we have to send to u8_strcmp() and/or
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   133
	 * u8_textprep() to represent the various normalization property
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   134
	 * values.
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   135
	 */
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   136
	static zprop_index_t normalize_table[] = {
5498
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   137
		{ "none",	0 },
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   138
		{ "formD",	U8_TEXTPREP_NFD },
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   139
		{ "formKC",	U8_TEXTPREP_NFKC },
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   140
		{ "formC",	U8_TEXTPREP_NFC },
334b476844ca 6622831 normalization properties are not preserved by "zfs send"
timh
parents: 5378
diff changeset
   141
		{ "formKD",	U8_TEXTPREP_NFKD },
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   142
		{ NULL }
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   143
	};
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   144
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   145
	static zprop_index_t version_table[] = {
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   146
		{ "1",		1 },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   147
		{ "2",		2 },
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   148
		{ "3",		3 },
9396
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   149
		{ "4",		4 },
11935
538c866aaac6 6716117 ZFS needs native system attribute infrastructure
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11876
diff changeset
   150
		{ "5",		5 },
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   151
		{ "current",	ZPL_VERSION },
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   152
		{ NULL }
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   153
	};
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   154
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   155
	static zprop_index_t boolean_table[] = {
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   156
		{ "off",	0 },
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   157
		{ "on",		1 },
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   158
		{ NULL }
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   159
	};
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   160
10310
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   161
	static zprop_index_t logbias_table[] = {
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   162
		{ "latency",	ZFS_LOGBIAS_LATENCY },
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   163
		{ "throughput",	ZFS_LOGBIAS_THROUGHPUT },
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   164
		{ NULL }
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   165
	};
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   166
6168
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   167
	static zprop_index_t canmount_table[] = {
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   168
		{ "off",	ZFS_CANMOUNT_OFF },
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   169
		{ "on",		ZFS_CANMOUNT_ON },
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   170
		{ "noauto",	ZFS_CANMOUNT_NOAUTO },
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   171
		{ NULL }
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   172
	};
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   173
7237
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   174
	static zprop_index_t cache_table[] = {
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   175
		{ "none",	ZFS_CACHE_NONE },
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   176
		{ "metadata",	ZFS_CACHE_METADATA },
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   177
		{ "all",	ZFS_CACHE_ALL },
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   178
		{ NULL }
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   179
	};
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   180
12294
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   181
	static zprop_index_t sync_table[] = {
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   182
		{ "standard",	ZFS_SYNC_STANDARD },
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   183
		{ "always",	ZFS_SYNC_ALWAYS },
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   184
		{ "disabled",	ZFS_SYNC_DISABLED },
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   185
		{ NULL }
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   186
	};
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   187
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   188
	/* inherit index properties */
12294
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   189
	zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   190
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   191
	    "standard | always | disabled", "SYNC",
2a74b443e6b1 PSARC/2010/108 zil synchronicity
Mark J Musante <Mark.Musante@Sun.COM>
parents: 12164
diff changeset
   192
	    sync_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   193
	zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   194
	    ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   195
	    ZFS_TYPE_VOLUME,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   196
	    "on | off | fletcher2 | fletcher4 | sha256", "CHECKSUM",
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   197
	    checksum_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   198
	zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   199
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
11183
93c7076216f6 6904243 zpool scrub/resilver doesn't work with cross-endian dedup=fletcher4,verify blocks
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 10972
diff changeset
   200
	    "on | off | verify | sha256[,verify]", "DEDUP",
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   201
	    dedup_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   202
	zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   203
	    ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   204
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   205
	    "on | off | lzjb | gzip | gzip-[1-9] | zle", "COMPRESS",
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   206
	    compress_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   207
	zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   208
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   209
	    "hidden | visible", "SNAPDIR", snapdir_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   210
	zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   211
	    ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
8053
271f44d3de11 PSARC/2008/659 New ZFS "passthrough-x" ACL inheritance rules
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 7390
diff changeset
   212
	    "discard | noallow | restricted | passthrough | passthrough-x",
6385
5437941ec5a1 PSARC/2008/231 New ZFS "passthrough" ACL inheritance rules
marks
parents: 6168
diff changeset
   213
	    "ACLINHERIT", acl_inherit_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   214
	zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   215
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   216
	    "1 | 2 | 3", "COPIES", copies_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   217
	zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",
7237
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   218
	    ZFS_CACHE_ALL, PROP_INHERIT,
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   219
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   220
	    "all | none | metadata", "PRIMARYCACHE", cache_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   221
	zprop_register_index(ZFS_PROP_SECONDARYCACHE, "secondarycache",
7237
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   222
	    ZFS_CACHE_ALL, PROP_INHERIT,
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   223
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
f47d41541b14 PSARC 2008/393 zfs primarycache and secondarycache properties
ek110237
parents: 6690
diff changeset
   224
	    "all | none | metadata", "SECONDARYCACHE", cache_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   225
	zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY,
10310
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   226
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
ba87b3315737 PSARC 2009/423 ZFS logbias property
Neil Perrin <Neil.Perrin@Sun.COM>
parents: 10242
diff changeset
   227
	    "latency | throughput", "LOGBIAS", logbias_table);
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   228
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   229
	/* inherit index (boolean) properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   230
	zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   231
	    ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   232
	zprop_register_index(ZFS_PROP_DEVICES, "devices", 1, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   233
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "DEVICES",
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   234
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   235
	zprop_register_index(ZFS_PROP_EXEC, "exec", 1, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   236
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "EXEC",
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   237
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   238
	zprop_register_index(ZFS_PROP_SETUID, "setuid", 1, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   239
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "SETUID",
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   240
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   241
	zprop_register_index(ZFS_PROP_READONLY, "readonly", 0, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   242
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off", "RDONLY",
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   243
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   244
	zprop_register_index(ZFS_PROP_ZONED, "zoned", 0, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   245
	    ZFS_TYPE_FILESYSTEM, "on | off", "ZONED", boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   246
	zprop_register_index(ZFS_PROP_XATTR, "xattr", 1, PROP_INHERIT,
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   247
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "XATTR",
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   248
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   249
	zprop_register_index(ZFS_PROP_VSCAN, "vscan", 0, PROP_INHERIT,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   250
	    ZFS_TYPE_FILESYSTEM, "on | off", "VSCAN",
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   251
	    boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   252
	zprop_register_index(ZFS_PROP_NBMAND, "nbmand", 0, PROP_INHERIT,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   253
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "NBMAND",
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   254
	    boolean_table);
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   255
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   256
	/* default index properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   257
	zprop_register_index(ZFS_PROP_VERSION, "version", 0, PROP_DEFAULT,
2597
21c0f93f2513 6349987 lzjb.c lived longer than expected?
nd150628
parents: 2474
diff changeset
   258
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
9396
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   259
	    "1 | 2 | 3 | 4 | current", "VERSION", version_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   260
	zprop_register_index(ZFS_PROP_CANMOUNT, "canmount", ZFS_CANMOUNT_ON,
6168
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   261
	    PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, "on | off | noauto",
51c045dcc498 PSARC 2008/168 Support for ZFS property value canmount=noauto
hs24103
parents: 5498
diff changeset
   262
	    "CANMOUNT", canmount_table);
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   263
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   264
	/* readonly index (boolean) properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   265
	zprop_register_index(ZFS_PROP_MOUNTED, "mounted", 0, PROP_READONLY,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   266
	    ZFS_TYPE_FILESYSTEM, "yes | no", "MOUNTED", boolean_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   267
	zprop_register_index(ZFS_PROP_DEFER_DESTROY, "defer_destroy", 0,
10242
c40d075fbca6 PSARC/2009/297 zfs snapshot holds
Chris Kirby <chris.kirby@sun.com>
parents: 9643
diff changeset
   268
	    PROP_READONLY, ZFS_TYPE_SNAPSHOT, "yes | no", "DEFER_DESTROY",
c40d075fbca6 PSARC/2009/297 zfs snapshot holds
Chris Kirby <chris.kirby@sun.com>
parents: 9643
diff changeset
   269
	    boolean_table);
4849
3a61e0a9a953 6536043 arc_byteswap_func_t and dmu_byteswap_func_t are redundant
ahrens
parents: 4787
diff changeset
   270
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   271
	/* set once index properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   272
	zprop_register_index(ZFS_PROP_NORMALIZE, "normalization", 0,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   273
	    PROP_ONETIME, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   274
	    "none | formC | formD | formKC | formKD", "NORMALIZATION",
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   275
	    normalize_table);
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   276
	zprop_register_index(ZFS_PROP_CASE, "casesensitivity",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   277
	    ZFS_CASE_SENSITIVE, PROP_ONETIME, ZFS_TYPE_FILESYSTEM |
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   278
	    ZFS_TYPE_SNAPSHOT,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   279
	    "sensitive | insensitive | mixed", "CASE", case_table);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   280
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   281
	/* set once index (boolean) properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   282
	zprop_register_index(ZFS_PROP_UTF8ONLY, "utf8only", 0, PROP_ONETIME,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   283
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   284
	    "on | off", "UTF8ONLY", boolean_table);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   285
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   286
	/* string properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   287
	zprop_register_string(ZFS_PROP_ORIGIN, "origin", NULL, PROP_READONLY,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   288
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<snapshot>", "ORIGIN");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   289
	zprop_register_string(ZFS_PROP_MOUNTPOINT, "mountpoint", "/",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   290
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "<path> | legacy | none",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   291
	    "MOUNTPOINT");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   292
	zprop_register_string(ZFS_PROP_SHARENFS, "sharenfs", "off",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   293
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | share(1M) options",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   294
	    "SHARENFS");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   295
	zprop_register_string(ZFS_PROP_TYPE, "type", NULL, PROP_READONLY,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   296
	    ZFS_TYPE_DATASET, "filesystem | volume | snapshot", "TYPE");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   297
	zprop_register_string(ZFS_PROP_SHARESMB, "sharesmb", "off",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   298
	    PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   299
	    "on | off | sharemgr(1M) options", "SHARESMB");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   300
	zprop_register_string(ZFS_PROP_MLSLABEL, "mlslabel",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   301
	    ZFS_MLSLABEL_DEFAULT, PROP_INHERIT, ZFS_TYPE_DATASET,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   302
	    "<sensitivity label>", "MLSLABEL");
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   303
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   304
	/* readonly number properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   305
	zprop_register_number(ZFS_PROP_USED, "used", 0, PROP_READONLY,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   306
	    ZFS_TYPE_DATASET, "<size>", "USED");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   307
	zprop_register_number(ZFS_PROP_AVAILABLE, "available", 0, PROP_READONLY,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   308
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "AVAIL");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   309
	zprop_register_number(ZFS_PROP_REFERENCED, "referenced", 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   310
	    PROP_READONLY, ZFS_TYPE_DATASET, "<size>", "REFER");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   311
	zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   312
	    PROP_READONLY, ZFS_TYPE_DATASET,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   313
	    "<1.00x or higher if compressed>", "RATIO");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   314
	zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize",
11449
a6be67f77b9f 6429996 zvols don't reserve enough space for requisite meta data
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 11183
diff changeset
   315
	    ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME,
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   316
	    ZFS_TYPE_VOLUME, "512 to 128k, power of 2",	"VOLBLOCK");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   317
	zprop_register_number(ZFS_PROP_USEDSNAP, "usedbysnapshots", 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   318
	    PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   319
	    "USEDSNAP");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   320
	zprop_register_number(ZFS_PROP_USEDDS, "usedbydataset", 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   321
	    PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   322
	    "USEDDS");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   323
	zprop_register_number(ZFS_PROP_USEDCHILD, "usedbychildren", 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   324
	    PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   325
	    "USEDCHILD");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   326
	zprop_register_number(ZFS_PROP_USEDREFRESERV, "usedbyrefreservation", 0,
7390
6d408f0a5fbd PSARC/2008/518 ZFS space accounting enhancements
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 7237
diff changeset
   327
	    PROP_READONLY,
6d408f0a5fbd PSARC/2008/518 ZFS space accounting enhancements
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 7237
diff changeset
   328
	    ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   329
	zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY,
10242
c40d075fbca6 PSARC/2009/297 zfs snapshot holds
Chris Kirby <chris.kirby@sun.com>
parents: 9643
diff changeset
   330
	    ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS");
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   331
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   332
	/* default number properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   333
	zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   334
	    ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   335
	zprop_register_number(ZFS_PROP_RESERVATION, "reservation", 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   336
	    PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   337
	    "<size> | none", "RESERV");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   338
	zprop_register_number(ZFS_PROP_VOLSIZE, "volsize", 0, PROP_DEFAULT,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   339
	    ZFS_TYPE_VOLUME, "<size>", "VOLSIZE");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   340
	zprop_register_number(ZFS_PROP_REFQUOTA, "refquota", 0, PROP_DEFAULT,
5378
111aa1baa84a PSARC 2007/555 zfs fs-only quotas and reservations
ck153898
parents: 5331
diff changeset
   341
	    ZFS_TYPE_FILESYSTEM, "<size> | none", "REFQUOTA");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   342
	zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0,
5378
111aa1baa84a PSARC 2007/555 zfs fs-only quotas and reservations
ck153898
parents: 5331
diff changeset
   343
	    PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
111aa1baa84a PSARC 2007/555 zfs fs-only quotas and reservations
ck153898
parents: 5331
diff changeset
   344
	    "<size> | none", "REFRESERV");
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   345
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   346
	/* inherit number properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   347
	zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   348
	    SPA_MAXBLOCKSIZE, PROP_INHERIT,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   349
	    ZFS_TYPE_FILESYSTEM, "512 to 128k, power of 2", "RECSIZE");
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   350
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   351
	/* hidden properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   352
	zprop_register_hidden(ZFS_PROP_CREATETXG, "createtxg", PROP_TYPE_NUMBER,
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   353
	    PROP_READONLY, ZFS_TYPE_DATASET, "CREATETXG");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   354
	zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER,
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   355
	    PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   356
	zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING,
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   357
	    PROP_READONLY, ZFS_TYPE_DATASET, "NAME");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   358
	zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions",
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   359
	    PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   360
	zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu",
9643
ffd8e7765f02 6736004 zvols need an additional property for comstar support
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 9396
diff changeset
   361
	    PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME,
ffd8e7765f02 6736004 zvols need an additional property for comstar support
Eric Taylor <Eric.Taylor@Sun.COM>
parents: 9396
diff changeset
   362
	    "STMF_SBD_LU");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   363
	zprop_register_hidden(ZFS_PROP_GUID, "guid", PROP_TYPE_NUMBER,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   364
	    PROP_READONLY, ZFS_TYPE_DATASET, "GUID");
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   365
	zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting",
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   366
	    PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET,
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   367
	    "USERACCOUNTING");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   368
	zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER,
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   369
	    PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE");
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   370
	zprop_register_hidden(ZFS_PROP_OBJSETID, "objsetid", PROP_TYPE_NUMBER,
10575
2a8816c5173b 6882196 resource.* events shouldn't be posted during spa_tryimport()
Eric Schrock <Eric.Schrock@Sun.COM>
parents: 10310
diff changeset
   371
	    PROP_READONLY, ZFS_TYPE_DATASET, "OBJSETID");
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   372
12164
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   373
	/*
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   374
	 * Property to be removed once libbe is integrated
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   375
	 */
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   376
	zprop_register_hidden(ZFS_PROP_PRIVATE, "priv_prop",
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   377
	    PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_FILESYSTEM,
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   378
	    "PRIV_PROP");
0eb8d6741e37 PSARC/2010/029 Improved ACL interoperability
Mark Shellenbaum <Mark.Shellenbaum@Sun.COM>
parents: 11976
diff changeset
   379
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   380
	/* oddball properties */
11976
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   381
	zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0,
3791e5495b0d 6931963 zfs_receive_004_neg test regression results in no reported error for invalid incremental receive
Tom Erickson <Tom.Erickson@Sun.COM>
parents: 11935
diff changeset
   382
	    NULL, PROP_READONLY, ZFS_TYPE_DATASET,
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   383
	    "<date>", "CREATION", B_FALSE, B_TRUE, NULL);
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   384
}
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   385
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   386
boolean_t
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   387
zfs_prop_delegatable(zfs_prop_t prop)
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   388
{
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   389
	zprop_desc_t *pd = &zfs_prop_table[prop];
10972
807794d41b3a PSARC 2009/348 Security Labels for ZFS
Ric Aleshire <Ric.Aleshire@Sun.COM>
parents: 10922
diff changeset
   390
807794d41b3a PSARC 2009/348 Security Labels for ZFS
Ric Aleshire <Ric.Aleshire@Sun.COM>
parents: 10922
diff changeset
   391
	/* The mlslabel property is never delegatable. */
807794d41b3a PSARC 2009/348 Security Labels for ZFS
Ric Aleshire <Ric.Aleshire@Sun.COM>
parents: 10922
diff changeset
   392
	if (prop == ZFS_PROP_MLSLABEL)
807794d41b3a PSARC 2009/348 Security Labels for ZFS
Ric Aleshire <Ric.Aleshire@Sun.COM>
parents: 10922
diff changeset
   393
		return (B_FALSE);
807794d41b3a PSARC 2009/348 Security Labels for ZFS
Ric Aleshire <Ric.Aleshire@Sun.COM>
parents: 10922
diff changeset
   394
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   395
	return (pd->pd_attr != PROP_READONLY);
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   396
}
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   397
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   398
/*
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   399
 * Given a zfs dataset property name, returns the corresponding property ID.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   400
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   401
zfs_prop_t
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   402
zfs_name_to_prop(const char *propname)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   403
{
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   404
	return (zprop_name_to_prop(propname, ZFS_TYPE_DATASET));
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   405
}
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   406
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   407
/*
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   408
 * For user property names, we allow all lowercase alphanumeric characters, plus
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   409
 * a few useful punctuation characters.
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   410
 */
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   411
static int
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   412
valid_char(char c)
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   413
{
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   414
	return ((c >= 'a' && c <= 'z') ||
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   415
	    (c >= '0' && c <= '9') ||
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   416
	    c == '-' || c == '_' || c == '.' || c == ':');
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   417
}
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   418
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   419
/*
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   420
 * Returns true if this is a valid user-defined property (one with a ':').
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   421
 */
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   422
boolean_t
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   423
zfs_prop_user(const char *name)
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   424
{
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   425
	int i;
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   426
	char c;
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   427
	boolean_t foundsep = B_FALSE;
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   428
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   429
	for (i = 0; i < strlen(name); i++) {
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   430
		c = name[i];
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   431
		if (!valid_char(c))
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   432
			return (B_FALSE);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   433
		if (c == ':')
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   434
			foundsep = B_TRUE;
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   435
	}
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   436
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   437
	if (!foundsep)
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   438
		return (B_FALSE);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   439
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   440
	return (B_TRUE);
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   441
}
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   442
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   443
/*
9396
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   444
 * Returns true if this is a valid userspace-type property (one with a '@').
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   445
 * Note that after the @, any character is valid (eg, another @, for SID
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   446
 * user@domain).
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   447
 */
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   448
boolean_t
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   449
zfs_prop_userquota(const char *name)
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   450
{
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   451
	zfs_userquota_prop_t prop;
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   452
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   453
	for (prop = 0; prop < ZFS_NUM_USERQUOTA_PROPS; prop++) {
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   454
		if (strncmp(name, zfs_userquota_prop_prefixes[prop],
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   455
		    strlen(zfs_userquota_prop_prefixes[prop])) == 0) {
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   456
			return (B_TRUE);
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   457
		}
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   458
	}
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   459
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   460
	return (B_FALSE);
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   461
}
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   462
f41cf682d0d3 PSARC/2009/204 ZFS user/group quotas & space accounting
Matthew Ahrens <Matthew.Ahrens@Sun.COM>
parents: 8053
diff changeset
   463
/*
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   464
 * Tables of index types, plus functions to convert between the user view
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   465
 * (strings) and internal representation (uint64_t).
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   466
 */
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   467
int
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   468
zfs_prop_string_to_index(zfs_prop_t prop, const char *string, uint64_t *index)
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   469
{
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   470
	return (zprop_string_to_index(prop, string, index, ZFS_TYPE_DATASET));
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   471
}
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   472
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   473
int
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   474
zfs_prop_index_to_string(zfs_prop_t prop, uint64_t index, const char **string)
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   475
{
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   476
	return (zprop_index_to_string(prop, index, string, ZFS_TYPE_DATASET));
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   477
}
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   478
10922
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   479
uint64_t
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   480
zfs_prop_random_value(zfs_prop_t prop, uint64_t seed)
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   481
{
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   482
	return (zprop_random_value(prop, seed, ZFS_TYPE_DATASET));
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   483
}
e2081f502306 PSARC 2009/571 ZFS Deduplication Properties
Jeff Bonwick <Jeff.Bonwick@Sun.COM>
parents: 10575
diff changeset
   484
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   485
/*
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   486
 * Returns TRUE if the property applies to any of the given dataset types.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   487
 */
6690
19b5b95523e1 6695219 Running 'zfs get all' on a snapshot should not display the user properties
gw25295
parents: 6643
diff changeset
   488
boolean_t
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   489
zfs_prop_valid_for_type(int prop, zfs_type_t types)
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   490
{
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   491
	return (zprop_valid_for_type(prop, types));
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   492
}
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   493
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   494
zprop_type_t
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   495
zfs_prop_get_type(zfs_prop_t prop)
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   496
{
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   497
	return (zfs_prop_table[prop].pd_proptype);
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   498
}
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   499
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   500
/*
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   501
 * Returns TRUE if the property is readonly.
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   502
 */
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   503
boolean_t
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   504
zfs_prop_readonly(zfs_prop_t prop)
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   505
{
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   506
	return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   507
	    zfs_prop_table[prop].pd_attr == PROP_ONETIME);
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   508
}
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   509
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   510
/*
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   511
 * Returns TRUE if the property is only allowed to be set once.
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   512
 */
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   513
boolean_t
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   514
zfs_prop_setonce(zfs_prop_t prop)
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   515
{
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   516
	return (zfs_prop_table[prop].pd_attr == PROP_ONETIME);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   517
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   518
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   519
const char *
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   520
zfs_prop_default_string(zfs_prop_t prop)
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   521
{
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   522
	return (zfs_prop_table[prop].pd_strdefault);
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   523
}
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   524
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   525
uint64_t
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   526
zfs_prop_default_numeric(zfs_prop_t prop)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   527
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   528
	return (zfs_prop_table[prop].pd_numdefault);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   529
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   530
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   531
/*
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   532
 * Given a dataset property ID, returns the corresponding name.
4451
24fbf2d7a5d7 PSARC 2007/197 ZFS hotplug
eschrock
parents: 3912
diff changeset
   533
 * Assuming the zfs dataset property ID is valid.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   534
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   535
const char *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   536
zfs_prop_to_name(zfs_prop_t prop)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   537
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   538
	return (zfs_prop_table[prop].pd_name);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   539
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   540
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   541
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   542
 * Returns TRUE if the property is inheritable.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   543
 */
5094
71a3e95fb9e2 PSARC 2007/342 Enhanced ZFS Pool Properties
lling
parents: 4849
diff changeset
   544
boolean_t
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   545
zfs_prop_inheritable(zfs_prop_t prop)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   546
{
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   547
	return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   548
	    zfs_prop_table[prop].pd_attr == PROP_ONETIME);
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   549
}
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   550
2717
ed589a32259d 6469385 zfs_set_prop_nvlist range checking is busted
eschrock
parents: 2676
diff changeset
   551
#ifndef _KERNEL
ed589a32259d 6469385 zfs_set_prop_nvlist range checking is busted
eschrock
parents: 2676
diff changeset
   552
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   553
/*
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   554
 * Returns a string describing the set of acceptable values for the given
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   555
 * zfs property, or NULL if it cannot be set.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   556
 */
3912
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   557
const char *
f6891a60bd72 PSARC 2007/083 ZFS bootable datasets
lling
parents: 3886
diff changeset
   558
zfs_prop_values(zfs_prop_t prop)
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   559
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   560
	return (zfs_prop_table[prop].pd_values);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   561
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   562
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   563
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   564
 * Returns TRUE if this property is a string type.  Note that index types
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   565
 * (compression, checksum) are treated as strings in userland, even though they
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   566
 * are stored numerically on disk.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   567
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   568
int
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   569
zfs_prop_is_string(zfs_prop_t prop)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   570
{
4787
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   571
	return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
602d3f97842c 6393351 unique_* could be improved
ahrens
parents: 4597
diff changeset
   572
	    zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   573
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   574
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   575
/*
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   576
 * Returns the column header for the given property.  Used only in
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   577
 * 'zfs list -o', but centralized here with the other property information.
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   578
 */
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   579
const char *
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   580
zfs_prop_column_name(zfs_prop_t prop)
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   581
{
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   582
	return (zfs_prop_table[prop].pd_colname);
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   583
}
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   584
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   585
/*
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   586
 * Returns whether the given property should be displayed right-justified for
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   587
 * 'zfs list'.
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   588
 */
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   589
boolean_t
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   590
zfs_prop_align_right(zfs_prop_t prop)
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   591
{
2676
5cee47eddab6 PSARC 2006/486 ZFS canmount property
eschrock
parents: 2597
diff changeset
   592
	return (zfs_prop_table[prop].pd_rightalign);
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   593
}
5331
3047ad28a67b PSARC/2007/218 caller_context_t in all VOPs
amw
parents: 5094
diff changeset
   594
789
b348f31ed315 PSARC 2002/240 ZFS
ahrens
parents:
diff changeset
   595
#endif