2025-01-04 11:04:27 +11:00
|
|
|
// SPDX-License-Identifier: CDDL-1.0
|
2008-11-20 12:01:55 -08:00
|
|
|
/*
|
|
|
|
|
* CDDL HEADER START
|
|
|
|
|
*
|
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
|
* Common Development and Distribution License (the "License").
|
|
|
|
|
* You may not use this file except in compliance with the License.
|
|
|
|
|
*
|
|
|
|
|
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
2022-07-11 23:16:13 +02:00
|
|
|
* or https://opensource.org/licenses/CDDL-1.0.
|
2008-11-20 12:01:55 -08:00
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
|
* and limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
|
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
|
|
|
|
* If applicable, add the following below this CDDL HEADER, with the
|
|
|
|
|
* fields enclosed by brackets "[]" replaced with your own identifying
|
|
|
|
|
* information: Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
|
*
|
|
|
|
|
* CDDL HEADER END
|
|
|
|
|
*/
|
|
|
|
|
/*
|
2010-05-28 13:45:14 -07:00
|
|
|
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
|
2019-06-19 09:48:13 -07:00
|
|
|
* Copyright (c) 2011, 2018 by Delphix. All rights reserved.
|
2013-10-07 06:53:58 -04:00
|
|
|
* Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
|
2017-01-23 21:17:35 +03:00
|
|
|
* Copyright 2016, Joyent, Inc.
|
2020-08-18 19:10:17 +02:00
|
|
|
* Copyright (c) 2019, Klara Inc.
|
|
|
|
|
* Copyright (c) 2019, Allan Jude
|
2022-10-20 05:37:51 +05:30
|
|
|
* Copyright (c) 2022 Hewlett Packard Enterprise Development LP.
|
2008-11-20 12:01:55 -08:00
|
|
|
*/
|
|
|
|
|
|
2010-05-28 13:45:14 -07:00
|
|
|
/* Portions Copyright 2010 Robert Milkowski */
|
|
|
|
|
|
2023-04-06 19:35:02 +02:00
|
|
|
#if defined(_KERNEL)
|
|
|
|
|
#include <sys/simd.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
#include <sys/zio.h>
|
|
|
|
|
#include <sys/spa.h>
|
|
|
|
|
#include <sys/u8_textprep.h>
|
|
|
|
|
#include <sys/zfs_acl.h>
|
|
|
|
|
#include <sys/zfs_ioctl.h>
|
|
|
|
|
#include <sys/zfs_znode.h>
|
2017-08-14 13:36:48 -04:00
|
|
|
#include <sys/dsl_crypt.h>
|
2024-09-20 11:16:44 -04:00
|
|
|
#include <sys/simd.h>
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
#include "zfs_prop.h"
|
|
|
|
|
#include "zfs_deleg.h"
|
2015-12-09 15:34:16 -08:00
|
|
|
#include "zfs_fletcher.h"
|
2008-11-20 12:01:55 -08:00
|
|
|
|
2018-02-15 17:53:18 -08:00
|
|
|
#if !defined(_KERNEL)
|
2008-11-20 12:01:55 -08:00
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <ctype.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
static zprop_desc_t zfs_prop_table[ZFS_NUM_PROPS];
|
|
|
|
|
|
2009-07-02 15:44:48 -07:00
|
|
|
/* Note this is indexed by zfs_userquota_prop_t, keep the order the same */
|
2022-01-15 00:37:55 +01:00
|
|
|
const char *const zfs_userquota_prop_prefixes[] = {
|
2009-07-02 15:44:48 -07:00
|
|
|
"userused@",
|
|
|
|
|
"userquota@",
|
|
|
|
|
"groupused@",
|
2016-10-04 11:46:10 -07:00
|
|
|
"groupquota@",
|
|
|
|
|
"userobjused@",
|
|
|
|
|
"userobjquota@",
|
|
|
|
|
"groupobjused@",
|
2018-02-14 06:54:54 +08:00
|
|
|
"groupobjquota@",
|
|
|
|
|
"projectused@",
|
|
|
|
|
"projectquota@",
|
|
|
|
|
"projectobjused@",
|
|
|
|
|
"projectobjquota@"
|
2009-07-02 15:44:48 -07:00
|
|
|
};
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
zprop_desc_t *
|
|
|
|
|
zfs_prop_get_table(void)
|
|
|
|
|
{
|
|
|
|
|
return (zfs_prop_table);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
zfs_prop_init(void)
|
|
|
|
|
{
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t checksum_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "on", ZIO_CHECKSUM_ON },
|
|
|
|
|
{ "off", ZIO_CHECKSUM_OFF },
|
|
|
|
|
{ "fletcher2", ZIO_CHECKSUM_FLETCHER_2 },
|
|
|
|
|
{ "fletcher4", ZIO_CHECKSUM_FLETCHER_4 },
|
|
|
|
|
{ "sha256", ZIO_CHECKSUM_SHA256 },
|
2016-06-15 15:47:05 -07:00
|
|
|
{ "noparity", ZIO_CHECKSUM_NOPARITY },
|
|
|
|
|
{ "sha512", ZIO_CHECKSUM_SHA512 },
|
|
|
|
|
{ "skein", ZIO_CHECKSUM_SKEIN },
|
|
|
|
|
{ "edonr", ZIO_CHECKSUM_EDONR },
|
2022-06-09 00:55:57 +02:00
|
|
|
{ "blake3", ZIO_CHECKSUM_BLAKE3 },
|
2008-11-20 12:01:55 -08:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t dedup_table[] = {
|
2010-05-28 13:45:14 -07:00
|
|
|
{ "on", ZIO_CHECKSUM_ON },
|
|
|
|
|
{ "off", ZIO_CHECKSUM_OFF },
|
|
|
|
|
{ "verify", ZIO_CHECKSUM_ON | ZIO_CHECKSUM_VERIFY },
|
|
|
|
|
{ "sha256", ZIO_CHECKSUM_SHA256 },
|
|
|
|
|
{ "sha256,verify",
|
|
|
|
|
ZIO_CHECKSUM_SHA256 | ZIO_CHECKSUM_VERIFY },
|
2016-06-15 15:47:05 -07:00
|
|
|
{ "sha512", ZIO_CHECKSUM_SHA512 },
|
|
|
|
|
{ "sha512,verify",
|
|
|
|
|
ZIO_CHECKSUM_SHA512 | ZIO_CHECKSUM_VERIFY },
|
|
|
|
|
{ "skein", ZIO_CHECKSUM_SKEIN },
|
|
|
|
|
{ "skein,verify",
|
|
|
|
|
ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY },
|
|
|
|
|
{ "edonr,verify",
|
|
|
|
|
ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY },
|
2022-06-09 00:55:57 +02:00
|
|
|
{ "blake3", ZIO_CHECKSUM_BLAKE3 },
|
|
|
|
|
{ "blake3,verify",
|
|
|
|
|
ZIO_CHECKSUM_BLAKE3 | ZIO_CHECKSUM_VERIFY },
|
2010-05-28 13:45:14 -07:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t compress_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "on", ZIO_COMPRESS_ON },
|
|
|
|
|
{ "off", ZIO_COMPRESS_OFF },
|
|
|
|
|
{ "lzjb", ZIO_COMPRESS_LZJB },
|
|
|
|
|
{ "gzip", ZIO_COMPRESS_GZIP_6 }, /* gzip default */
|
|
|
|
|
{ "gzip-1", ZIO_COMPRESS_GZIP_1 },
|
|
|
|
|
{ "gzip-2", ZIO_COMPRESS_GZIP_2 },
|
|
|
|
|
{ "gzip-3", ZIO_COMPRESS_GZIP_3 },
|
|
|
|
|
{ "gzip-4", ZIO_COMPRESS_GZIP_4 },
|
|
|
|
|
{ "gzip-5", ZIO_COMPRESS_GZIP_5 },
|
|
|
|
|
{ "gzip-6", ZIO_COMPRESS_GZIP_6 },
|
|
|
|
|
{ "gzip-7", ZIO_COMPRESS_GZIP_7 },
|
|
|
|
|
{ "gzip-8", ZIO_COMPRESS_GZIP_8 },
|
|
|
|
|
{ "gzip-9", ZIO_COMPRESS_GZIP_9 },
|
2010-05-28 13:45:14 -07:00
|
|
|
{ "zle", ZIO_COMPRESS_ZLE },
|
2013-01-23 10:54:30 +01:00
|
|
|
{ "lz4", ZIO_COMPRESS_LZ4 },
|
2020-08-18 19:10:17 +02:00
|
|
|
{ "zstd", ZIO_COMPRESS_ZSTD },
|
|
|
|
|
{ "zstd-fast",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_DEFAULT) },
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* ZSTD 1-19 are synthetic. We store the compression level in a
|
|
|
|
|
* separate hidden property to avoid wasting a large amount of
|
|
|
|
|
* space in the ZIO_COMPRESS enum.
|
|
|
|
|
*
|
|
|
|
|
* The compression level is also stored within the header of the
|
|
|
|
|
* compressed block since we may need it for later recompression
|
|
|
|
|
* to avoid checksum errors (L2ARC).
|
|
|
|
|
*
|
|
|
|
|
* Note that the level here is defined as bit shifted mask on
|
|
|
|
|
* top of the method.
|
|
|
|
|
*/
|
|
|
|
|
{ "zstd-1", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_1) },
|
|
|
|
|
{ "zstd-2", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_2) },
|
|
|
|
|
{ "zstd-3", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_3) },
|
|
|
|
|
{ "zstd-4", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_4) },
|
|
|
|
|
{ "zstd-5", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_5) },
|
|
|
|
|
{ "zstd-6", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_6) },
|
|
|
|
|
{ "zstd-7", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_7) },
|
|
|
|
|
{ "zstd-8", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_8) },
|
|
|
|
|
{ "zstd-9", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_9) },
|
|
|
|
|
{ "zstd-10", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_10) },
|
|
|
|
|
{ "zstd-11", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_11) },
|
|
|
|
|
{ "zstd-12", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_12) },
|
|
|
|
|
{ "zstd-13", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_13) },
|
|
|
|
|
{ "zstd-14", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_14) },
|
|
|
|
|
{ "zstd-15", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_15) },
|
|
|
|
|
{ "zstd-16", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_16) },
|
|
|
|
|
{ "zstd-17", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_17) },
|
|
|
|
|
{ "zstd-18", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_18) },
|
|
|
|
|
{ "zstd-19", ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_19) },
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* The ZSTD-Fast levels are also synthetic.
|
|
|
|
|
*/
|
|
|
|
|
{ "zstd-fast-1",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_1) },
|
|
|
|
|
{ "zstd-fast-2",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_2) },
|
|
|
|
|
{ "zstd-fast-3",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_3) },
|
|
|
|
|
{ "zstd-fast-4",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_4) },
|
|
|
|
|
{ "zstd-fast-5",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_5) },
|
|
|
|
|
{ "zstd-fast-6",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_6) },
|
|
|
|
|
{ "zstd-fast-7",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_7) },
|
|
|
|
|
{ "zstd-fast-8",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_8) },
|
|
|
|
|
{ "zstd-fast-9",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_9) },
|
|
|
|
|
{ "zstd-fast-10",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_10) },
|
|
|
|
|
{ "zstd-fast-20",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_20) },
|
|
|
|
|
{ "zstd-fast-30",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_30) },
|
|
|
|
|
{ "zstd-fast-40",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_40) },
|
|
|
|
|
{ "zstd-fast-50",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_50) },
|
|
|
|
|
{ "zstd-fast-60",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_60) },
|
|
|
|
|
{ "zstd-fast-70",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_70) },
|
|
|
|
|
{ "zstd-fast-80",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_80) },
|
|
|
|
|
{ "zstd-fast-90",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_90) },
|
|
|
|
|
{ "zstd-fast-100",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_100) },
|
|
|
|
|
{ "zstd-fast-500",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_500) },
|
|
|
|
|
{ "zstd-fast-1000",
|
|
|
|
|
ZIO_COMPLEVEL_ZSTD(ZIO_ZSTD_LEVEL_FAST_1000) },
|
2008-11-20 12:01:55 -08:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t crypto_table[] = {
|
2017-08-14 13:36:48 -04:00
|
|
|
{ "on", ZIO_CRYPT_ON },
|
|
|
|
|
{ "off", ZIO_CRYPT_OFF },
|
|
|
|
|
{ "aes-128-ccm", ZIO_CRYPT_AES_128_CCM },
|
|
|
|
|
{ "aes-192-ccm", ZIO_CRYPT_AES_192_CCM },
|
|
|
|
|
{ "aes-256-ccm", ZIO_CRYPT_AES_256_CCM },
|
|
|
|
|
{ "aes-128-gcm", ZIO_CRYPT_AES_128_GCM },
|
|
|
|
|
{ "aes-192-gcm", ZIO_CRYPT_AES_192_GCM },
|
|
|
|
|
{ "aes-256-gcm", ZIO_CRYPT_AES_256_GCM },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t keyformat_table[] = {
|
2017-08-14 13:36:48 -04:00
|
|
|
{ "none", ZFS_KEYFORMAT_NONE },
|
|
|
|
|
{ "raw", ZFS_KEYFORMAT_RAW },
|
|
|
|
|
{ "hex", ZFS_KEYFORMAT_HEX },
|
|
|
|
|
{ "passphrase", ZFS_KEYFORMAT_PASSPHRASE },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t snapdir_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "hidden", ZFS_SNAPDIR_HIDDEN },
|
|
|
|
|
{ "visible", ZFS_SNAPDIR_VISIBLE },
|
2024-10-02 09:12:02 -07:00
|
|
|
{ "disabled", ZFS_SNAPDIR_DISABLED },
|
2008-11-20 12:01:55 -08:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t snapdev_table[] = {
|
2013-02-14 00:11:59 +01:00
|
|
|
{ "hidden", ZFS_SNAPDEV_HIDDEN },
|
|
|
|
|
{ "visible", ZFS_SNAPDEV_VISIBLE },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t acl_mode_table[] = {
|
2020-02-04 11:40:08 -05:00
|
|
|
{ "discard", ZFS_ACL_DISCARD },
|
|
|
|
|
{ "groupmask", ZFS_ACL_GROUPMASK },
|
|
|
|
|
{ "passthrough", ZFS_ACL_PASSTHROUGH },
|
|
|
|
|
{ "restricted", ZFS_ACL_RESTRICTED },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t acltype_table[] = {
|
2013-10-28 09:22:15 -07:00
|
|
|
{ "off", ZFS_ACLTYPE_OFF },
|
2020-09-16 15:26:06 -04:00
|
|
|
{ "posix", ZFS_ACLTYPE_POSIX },
|
2020-10-14 00:25:48 -04:00
|
|
|
{ "nfsv4", ZFS_ACLTYPE_NFSV4 },
|
2020-09-16 15:26:06 -04:00
|
|
|
{ "disabled", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
|
|
|
|
|
{ "noacl", ZFS_ACLTYPE_OFF }, /* bkwrd compatibility */
|
|
|
|
|
{ "posixacl", ZFS_ACLTYPE_POSIX }, /* bkwrd compatibility */
|
2013-10-28 09:22:15 -07:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t acl_inherit_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "discard", ZFS_ACL_DISCARD },
|
|
|
|
|
{ "noallow", ZFS_ACL_NOALLOW },
|
|
|
|
|
{ "restricted", ZFS_ACL_RESTRICTED },
|
|
|
|
|
{ "passthrough", ZFS_ACL_PASSTHROUGH },
|
2017-01-03 18:31:18 +01:00
|
|
|
{ "secure", ZFS_ACL_RESTRICTED }, /* bkwrd compatibility */
|
2008-12-03 12:09:06 -08:00
|
|
|
{ "passthrough-x", ZFS_ACL_PASSTHROUGH_X },
|
2008-11-20 12:01:55 -08:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t case_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "sensitive", ZFS_CASE_SENSITIVE },
|
|
|
|
|
{ "insensitive", ZFS_CASE_INSENSITIVE },
|
|
|
|
|
{ "mixed", ZFS_CASE_MIXED },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t copies_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "1", 1 },
|
|
|
|
|
{ "2", 2 },
|
|
|
|
|
{ "3", 3 },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Use the unique flags we have to send to u8_strcmp() and/or
|
|
|
|
|
* u8_textprep() to represent the various normalization property
|
|
|
|
|
* values.
|
|
|
|
|
*/
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t normalize_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "none", 0 },
|
|
|
|
|
{ "formD", U8_TEXTPREP_NFD },
|
|
|
|
|
{ "formKC", U8_TEXTPREP_NFKC },
|
|
|
|
|
{ "formC", U8_TEXTPREP_NFC },
|
|
|
|
|
{ "formKD", U8_TEXTPREP_NFKD },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t version_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "1", 1 },
|
|
|
|
|
{ "2", 2 },
|
|
|
|
|
{ "3", 3 },
|
2009-07-02 15:44:48 -07:00
|
|
|
{ "4", 4 },
|
2010-05-28 13:45:14 -07:00
|
|
|
{ "5", 5 },
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "current", ZPL_VERSION },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t boolean_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "off", 0 },
|
|
|
|
|
{ "on", 1 },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t keystatus_table[] = {
|
2017-08-14 13:36:48 -04:00
|
|
|
{ "none", ZFS_KEYSTATUS_NONE},
|
|
|
|
|
{ "unavailable", ZFS_KEYSTATUS_UNAVAILABLE},
|
|
|
|
|
{ "available", ZFS_KEYSTATUS_AVAILABLE},
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t logbias_table[] = {
|
2010-05-28 13:45:14 -07:00
|
|
|
{ "latency", ZFS_LOGBIAS_LATENCY },
|
|
|
|
|
{ "throughput", ZFS_LOGBIAS_THROUGHPUT },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t canmount_table[] = {
|
2008-11-20 12:01:55 -08:00
|
|
|
{ "off", ZFS_CANMOUNT_OFF },
|
|
|
|
|
{ "on", ZFS_CANMOUNT_ON },
|
|
|
|
|
{ "noauto", ZFS_CANMOUNT_NOAUTO },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t cache_table[] = {
|
2008-12-03 12:09:06 -08:00
|
|
|
{ "none", ZFS_CACHE_NONE },
|
|
|
|
|
{ "metadata", ZFS_CACHE_METADATA },
|
|
|
|
|
{ "all", ZFS_CACHE_ALL },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2023-10-24 11:00:07 -07:00
|
|
|
static const zprop_index_t prefetch_table[] = {
|
|
|
|
|
{ "none", ZFS_PREFETCH_NONE },
|
|
|
|
|
{ "metadata", ZFS_PREFETCH_METADATA },
|
|
|
|
|
{ "all", ZFS_PREFETCH_ALL },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t sync_table[] = {
|
2010-05-28 13:45:14 -07:00
|
|
|
{ "standard", ZFS_SYNC_STANDARD },
|
|
|
|
|
{ "always", ZFS_SYNC_ALWAYS },
|
|
|
|
|
{ "disabled", ZFS_SYNC_DISABLED },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t xattr_table[] = {
|
2011-10-24 16:55:20 -07:00
|
|
|
{ "off", ZFS_XATTR_OFF },
|
|
|
|
|
{ "sa", ZFS_XATTR_SA },
|
2025-10-01 12:14:56 -07:00
|
|
|
{ "on", ZFS_XATTR_SA },
|
2011-10-24 16:55:20 -07:00
|
|
|
{ "dir", ZFS_XATTR_DIR },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t dnsize_table[] = {
|
2016-03-16 18:25:34 -07:00
|
|
|
{ "legacy", ZFS_DNSIZE_LEGACY },
|
|
|
|
|
{ "auto", ZFS_DNSIZE_AUTO },
|
|
|
|
|
{ "1k", ZFS_DNSIZE_1K },
|
|
|
|
|
{ "2k", ZFS_DNSIZE_2K },
|
|
|
|
|
{ "4k", ZFS_DNSIZE_4K },
|
|
|
|
|
{ "8k", ZFS_DNSIZE_8K },
|
|
|
|
|
{ "16k", ZFS_DNSIZE_16K },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t redundant_metadata_table[] = {
|
2014-05-23 08:21:07 -08:00
|
|
|
{ "all", ZFS_REDUNDANT_METADATA_ALL },
|
|
|
|
|
{ "most", ZFS_REDUNDANT_METADATA_MOST },
|
2022-10-20 05:37:51 +05:30
|
|
|
{ "some", ZFS_REDUNDANT_METADATA_SOME },
|
|
|
|
|
{ "none", ZFS_REDUNDANT_METADATA_NONE },
|
2014-05-23 08:21:07 -08:00
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-16 22:26:04 +01:00
|
|
|
static const zprop_index_t volmode_table[] = {
|
2017-07-12 22:05:37 +02:00
|
|
|
{ "default", ZFS_VOLMODE_DEFAULT },
|
|
|
|
|
{ "full", ZFS_VOLMODE_GEOM },
|
|
|
|
|
{ "geom", ZFS_VOLMODE_GEOM },
|
|
|
|
|
{ "dev", ZFS_VOLMODE_DEV },
|
|
|
|
|
{ "none", ZFS_VOLMODE_NONE },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-14 16:47:59 -04:00
|
|
|
static const zprop_index_t direct_table[] = {
|
|
|
|
|
{ "disabled", ZFS_DIRECT_DISABLED },
|
|
|
|
|
{ "standard", ZFS_DIRECT_STANDARD },
|
|
|
|
|
{ "always", ZFS_DIRECT_ALWAYS },
|
|
|
|
|
{ NULL }
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-17 01:43:10 +01:00
|
|
|
struct zfs_mod_supported_features *sfeatures =
|
|
|
|
|
zfs_mod_list_supported(ZFS_SYSFS_DATASET_PROPERTIES);
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
/* inherit index properties */
|
2014-05-23 08:21:07 -08:00
|
|
|
zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
|
|
|
|
|
ZFS_REDUNDANT_METADATA_ALL,
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-10-20 05:37:51 +05:30
|
|
|
"all | most | some | none", "REDUND_MD",
|
2021-12-17 01:43:10 +01:00
|
|
|
redundant_metadata_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_SYNC, "sync", ZFS_SYNC_STANDARD,
|
2008-11-20 12:01:55 -08:00
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2010-05-28 13:45:14 -07:00
|
|
|
"standard | always | disabled", "SYNC",
|
2021-12-17 01:43:10 +01:00
|
|
|
sync_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_CHECKSUM, "checksum",
|
|
|
|
|
ZIO_CHECKSUM_DEFAULT, PROP_INHERIT, ZFS_TYPE_FILESYSTEM |
|
|
|
|
|
ZFS_TYPE_VOLUME,
|
2019-12-05 13:10:29 -08:00
|
|
|
"on | off | fletcher2 | fletcher4 | sha256 | sha512 | skein"
|
2022-06-09 00:55:57 +02:00
|
|
|
" | edonr | blake3",
|
2021-12-17 01:43:10 +01:00
|
|
|
"CHECKSUM", checksum_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_DEDUP, "dedup", ZIO_CHECKSUM_OFF,
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2020-08-22 13:58:07 -04:00
|
|
|
"on | off | verify | sha256[,verify] | sha512[,verify] | "
|
2022-06-09 00:55:57 +02:00
|
|
|
"skein[,verify] | edonr,verify | blake3[,verify]",
|
2021-12-17 01:43:10 +01:00
|
|
|
"DEDUP", dedup_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_COMPRESSION, "compression",
|
2008-11-20 12:01:55 -08:00
|
|
|
ZIO_COMPRESS_DEFAULT, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2020-08-18 19:10:17 +02:00
|
|
|
"on | off | lzjb | gzip | gzip-[1-9] | zle | lz4 | "
|
|
|
|
|
"zstd | zstd-[1-19] | "
|
2021-03-03 16:14:19 +00:00
|
|
|
"zstd-fast | zstd-fast-[1-10,20,30,40,50,60,70,80,90,100,500,1000]",
|
2021-12-17 01:43:10 +01:00
|
|
|
"COMPRESS", compress_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_SNAPDIR, "snapdir", ZFS_SNAPDIR_HIDDEN,
|
2008-11-20 12:01:55 -08:00
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
2024-10-02 09:12:02 -07:00
|
|
|
"disabled | hidden | visible", "SNAPDIR", snapdir_table, sfeatures);
|
2013-02-14 00:11:59 +01:00
|
|
|
zprop_register_index(ZFS_PROP_SNAPDEV, "snapdev", ZFS_SNAPDEV_HIDDEN,
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"hidden | visible", "SNAPDEV", snapdev_table, sfeatures);
|
2020-02-04 11:40:08 -05:00
|
|
|
zprop_register_index(ZFS_PROP_ACLMODE, "aclmode", ZFS_ACL_DISCARD,
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
|
|
|
|
"discard | groupmask | passthrough | restricted", "ACLMODE",
|
2021-12-17 01:43:10 +01:00
|
|
|
acl_mode_table, sfeatures);
|
2020-10-14 00:25:48 -04:00
|
|
|
zprop_register_index(ZFS_PROP_ACLTYPE, "acltype",
|
|
|
|
|
#ifdef __linux__
|
|
|
|
|
/* Linux doesn't natively support ZFS's NFSv4-style ACLs. */
|
|
|
|
|
ZFS_ACLTYPE_OFF,
|
|
|
|
|
#else
|
|
|
|
|
ZFS_ACLTYPE_NFSV4,
|
2019-12-05 00:45:14 +00:00
|
|
|
#endif
|
2020-10-14 00:25:48 -04:00
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
2021-12-17 01:43:10 +01:00
|
|
|
"off | nfsv4 | posix", "ACLTYPE", acltype_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_ACLINHERIT, "aclinherit",
|
|
|
|
|
ZFS_ACL_RESTRICTED, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
2008-12-03 12:09:06 -08:00
|
|
|
"discard | noallow | restricted | passthrough | passthrough-x",
|
2021-12-17 01:43:10 +01:00
|
|
|
"ACLINHERIT", acl_inherit_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_COPIES, "copies", 1, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"1 | 2 | 3", "COPIES", copies_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_PRIMARYCACHE, "primarycache",
|
2008-12-03 12:09:06 -08:00
|
|
|
ZFS_CACHE_ALL, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"all | none | metadata", "PRIMARYCACHE", cache_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_SECONDARYCACHE, "secondarycache",
|
2008-12-03 12:09:06 -08:00
|
|
|
ZFS_CACHE_ALL, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"all | none | metadata", "SECONDARYCACHE", cache_table, sfeatures);
|
2023-10-24 11:00:07 -07:00
|
|
|
zprop_register_index(ZFS_PROP_PREFETCH, "prefetch",
|
|
|
|
|
ZFS_PREFETCH_ALL, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME,
|
|
|
|
|
"none | metadata | all", "PREFETCH", prefetch_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_LOGBIAS, "logbias", ZFS_LOGBIAS_LATENCY,
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"latency | throughput", "LOGBIAS", logbias_table, sfeatures);
|
2024-09-23 19:50:48 +03:00
|
|
|
zprop_register_index(ZFS_PROP_XATTR, "xattr", ZFS_XATTR_SA,
|
2011-10-24 16:55:20 -07:00
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
2021-12-17 01:43:10 +01:00
|
|
|
"on | off | dir | sa", "XATTR", xattr_table, sfeatures);
|
2016-03-16 18:25:34 -07:00
|
|
|
zprop_register_index(ZFS_PROP_DNODESIZE, "dnodesize",
|
|
|
|
|
ZFS_DNSIZE_LEGACY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
2021-12-17 01:43:10 +01:00
|
|
|
"legacy | auto | 1k | 2k | 4k | 8k | 16k", "DNSIZE", dnsize_table,
|
|
|
|
|
sfeatures);
|
2017-07-12 22:05:37 +02:00
|
|
|
zprop_register_index(ZFS_PROP_VOLMODE, "volmode",
|
|
|
|
|
ZFS_VOLMODE_DEFAULT, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"default | full | geom | dev | none", "VOLMODE", volmode_table,
|
|
|
|
|
sfeatures);
|
2024-09-14 16:47:59 -04:00
|
|
|
zprop_register_index(ZFS_PROP_DIRECT, "direct",
|
|
|
|
|
ZFS_DIRECT_STANDARD, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
|
|
|
|
"disabled | standard | always", "DIRECT", direct_table,
|
|
|
|
|
sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* inherit index (boolean) properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "ATIME", boolean_table, sfeatures);
|
2022-08-13 00:20:25 +03:00
|
|
|
zprop_register_index(ZFS_PROP_RELATIME, "relatime", 1, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "RELATIME", boolean_table,
|
|
|
|
|
sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_DEVICES, "devices", 1, PROP_INHERIT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "DEVICES",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_EXEC, "exec", 1, PROP_INHERIT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "EXEC",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_SETUID, "setuid", 1, PROP_INHERIT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "SETUID",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_READONLY, "readonly", 0, PROP_INHERIT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "on | off", "RDONLY",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2019-12-11 11:58:37 -08:00
|
|
|
#ifdef __FreeBSD__
|
|
|
|
|
zprop_register_index(ZFS_PROP_ZONED, "jailed", 0, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "JAILED", boolean_table,
|
|
|
|
|
sfeatures);
|
2019-12-11 11:58:37 -08:00
|
|
|
#else
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_ZONED, "zoned", 0, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "ZONED", boolean_table, sfeatures);
|
2019-12-11 11:58:37 -08:00
|
|
|
#endif
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_VSCAN, "vscan", 0, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "VSCAN", boolean_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_NBMAND, "nbmand", 0, PROP_INHERIT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "on | off", "NBMAND",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2020-03-06 12:28:19 -05:00
|
|
|
zprop_register_index(ZFS_PROP_OVERLAY, "overlay", 1, PROP_INHERIT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "OVERLAY", boolean_table,
|
|
|
|
|
sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* default index properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_VERSION, "version", 0, PROP_DEFAULT,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
2021-12-17 01:43:10 +01:00
|
|
|
"1 | 2 | 3 | 4 | 5 | current", "VERSION", version_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_CANMOUNT, "canmount", ZFS_CANMOUNT_ON,
|
2008-11-20 12:01:55 -08:00
|
|
|
PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, "on | off | noauto",
|
2021-12-17 01:43:10 +01:00
|
|
|
"CANMOUNT", canmount_table, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
2017-08-14 13:36:48 -04:00
|
|
|
/* readonly index properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_MOUNTED, "mounted", 0, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "yes | no", "MOUNTED", boolean_table,
|
|
|
|
|
sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_DEFER_DESTROY, "defer_destroy", 0,
|
2009-08-18 11:43:27 -07:00
|
|
|
PROP_READONLY, ZFS_TYPE_SNAPSHOT, "yes | no", "DEFER_DESTROY",
|
2021-12-17 01:43:10 +01:00
|
|
|
boolean_table, sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_index(ZFS_PROP_KEYSTATUS, "keystatus",
|
|
|
|
|
ZFS_KEYSTATUS_NONE, PROP_READONLY, ZFS_TYPE_DATASET,
|
|
|
|
|
"none | unavailable | available",
|
2021-12-17 01:43:10 +01:00
|
|
|
"KEYSTATUS", keystatus_table, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* set once index properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_NORMALIZE, "normalization", 0,
|
2008-11-20 12:01:55 -08:00
|
|
|
PROP_ONETIME, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
|
|
|
|
"none | formC | formD | formKC | formKD", "NORMALIZATION",
|
2021-12-17 01:43:10 +01:00
|
|
|
normalize_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_CASE, "casesensitivity",
|
|
|
|
|
ZFS_CASE_SENSITIVE, PROP_ONETIME, ZFS_TYPE_FILESYSTEM |
|
|
|
|
|
ZFS_TYPE_SNAPSHOT,
|
2021-12-17 01:43:10 +01:00
|
|
|
"sensitive | insensitive | mixed", "CASE", case_table, sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_index(ZFS_PROP_KEYFORMAT, "keyformat",
|
|
|
|
|
ZFS_KEYFORMAT_NONE, PROP_ONETIME_DEFAULT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"none | raw | hex | passphrase", "KEYFORMAT", keyformat_table,
|
|
|
|
|
sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_index(ZFS_PROP_ENCRYPTION, "encryption",
|
|
|
|
|
ZIO_CRYPT_DEFAULT, PROP_ONETIME, ZFS_TYPE_DATASET,
|
|
|
|
|
"on | off | aes-128-ccm | aes-192-ccm | aes-256-ccm | "
|
|
|
|
|
"aes-128-gcm | aes-192-gcm | aes-256-gcm", "ENCRYPTION",
|
2021-12-17 01:43:10 +01:00
|
|
|
crypto_table, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* set once index (boolean) properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_index(ZFS_PROP_UTF8ONLY, "utf8only", 0, PROP_ONETIME,
|
2008-11-20 12:01:55 -08:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
2021-12-17 01:43:10 +01:00
|
|
|
"on | off", "UTF8ONLY", boolean_table, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* string properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_ORIGIN, "origin", NULL, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<snapshot>", "ORIGIN",
|
|
|
|
|
sfeatures);
|
2011-11-17 10:14:36 -08:00
|
|
|
zprop_register_string(ZFS_PROP_CLONES, "clones", NULL, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_SNAPSHOT, "<dataset>[,...]", "CLONES", sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_MOUNTPOINT, "mountpoint", "/",
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "<path> | legacy | none",
|
2021-12-17 01:43:10 +01:00
|
|
|
"MOUNTPOINT", sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_SHARENFS, "sharenfs", "off",
|
2020-10-30 11:55:59 -04:00
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "on | off | NFS share options",
|
2021-12-17 01:43:10 +01:00
|
|
|
"SHARENFS", sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_TYPE, "type", NULL, PROP_READONLY,
|
2013-12-11 14:33:41 -08:00
|
|
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK,
|
2021-12-17 01:43:10 +01:00
|
|
|
"filesystem | volume | snapshot | bookmark", "TYPE", sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_SHARESMB, "sharesmb", "off",
|
|
|
|
|
PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
2021-12-17 01:43:10 +01:00
|
|
|
"on | off | SMB share options", "SHARESMB", sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_string(ZFS_PROP_MLSLABEL, "mlslabel",
|
|
|
|
|
ZFS_MLSLABEL_DEFAULT, PROP_INHERIT, ZFS_TYPE_DATASET,
|
2021-12-17 01:43:10 +01:00
|
|
|
"<sensitivity label>", "MLSLABEL", sfeatures);
|
2013-12-19 00:24:14 -06:00
|
|
|
zprop_register_string(ZFS_PROP_SELINUX_CONTEXT, "context",
|
|
|
|
|
"none", PROP_DEFAULT, ZFS_TYPE_DATASET, "<selinux context>",
|
2021-12-17 01:43:10 +01:00
|
|
|
"CONTEXT", sfeatures);
|
2013-12-19 00:24:14 -06:00
|
|
|
zprop_register_string(ZFS_PROP_SELINUX_FSCONTEXT, "fscontext",
|
|
|
|
|
"none", PROP_DEFAULT, ZFS_TYPE_DATASET, "<selinux fscontext>",
|
2021-12-17 01:43:10 +01:00
|
|
|
"FSCONTEXT", sfeatures);
|
2013-12-19 00:24:14 -06:00
|
|
|
zprop_register_string(ZFS_PROP_SELINUX_DEFCONTEXT, "defcontext",
|
|
|
|
|
"none", PROP_DEFAULT, ZFS_TYPE_DATASET, "<selinux defcontext>",
|
2021-12-17 01:43:10 +01:00
|
|
|
"DEFCONTEXT", sfeatures);
|
2013-12-19 00:24:14 -06:00
|
|
|
zprop_register_string(ZFS_PROP_SELINUX_ROOTCONTEXT, "rootcontext",
|
|
|
|
|
"none", PROP_DEFAULT, ZFS_TYPE_DATASET, "<selinux rootcontext>",
|
2021-12-17 01:43:10 +01:00
|
|
|
"ROOTCONTEXT", sfeatures);
|
2016-01-06 22:22:48 +01:00
|
|
|
zprop_register_string(ZFS_PROP_RECEIVE_RESUME_TOKEN,
|
|
|
|
|
"receive_resume_token",
|
|
|
|
|
NULL, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"<string token>", "RESUMETOK", sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_string(ZFS_PROP_ENCRYPTION_ROOT, "encryptionroot", NULL,
|
|
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "<filesystem | volume>",
|
2021-12-17 01:43:10 +01:00
|
|
|
"ENCROOT", sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_string(ZFS_PROP_KEYLOCATION, "keylocation",
|
|
|
|
|
"none", PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2021-12-17 01:43:10 +01:00
|
|
|
"prompt | <file URI> | <https URL> | <http URL>", "KEYLOCATION",
|
|
|
|
|
sfeatures);
|
2019-06-19 09:48:13 -07:00
|
|
|
zprop_register_string(ZFS_PROP_REDACT_SNAPS,
|
|
|
|
|
"redact_snaps", NULL, PROP_READONLY,
|
|
|
|
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<snapshot>[,...]",
|
2021-12-17 01:43:10 +01:00
|
|
|
"RSNAPS", sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* readonly number properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USED, "used", 0, PROP_READONLY,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_DATASET, "<size>", "USED", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_AVAILABLE, "available", 0, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "AVAIL",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_REFERENCED, "referenced", 0,
|
2019-06-19 09:48:13 -07:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"REFER", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_COMPRESSRATIO, "compressratio", 0,
|
2019-06-19 09:48:13 -07:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<1.00x or higher if compressed>", "RATIO", B_FALSE, sfeatures);
|
2011-07-26 12:23:00 -07:00
|
|
|
zprop_register_number(ZFS_PROP_REFRATIO, "refcompressratio", 0,
|
|
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<1.00x or higher if compressed>", "REFRATIO", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_VOLBLOCKSIZE, "volblocksize",
|
|
|
|
|
ZVOL_DEFAULT_BLOCKSIZE, PROP_ONETIME,
|
2025-07-02 14:11:37 -04:00
|
|
|
ZFS_TYPE_VOLUME, "512 to 16M, power of 2", "VOLBLOCK", B_FALSE,
|
2022-02-20 03:07:25 +01:00
|
|
|
sfeatures);
|
2023-10-25 02:53:27 +05:00
|
|
|
zprop_register_index(ZFS_PROP_VOLTHREADING, "volthreading",
|
|
|
|
|
1, PROP_DEFAULT, ZFS_TYPE_VOLUME, "on | off", "zvol threading",
|
|
|
|
|
boolean_table, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USEDSNAP, "usedbysnapshots", 0,
|
|
|
|
|
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"USEDSNAP", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USEDDS, "usedbydataset", 0,
|
|
|
|
|
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"USEDDS", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USEDCHILD, "usedbychildren", 0,
|
|
|
|
|
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"USEDCHILD", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USEDREFRESERV, "usedbyrefreservation", 0,
|
2008-12-03 12:09:06 -08:00
|
|
|
PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS", B_FALSE, sfeatures);
|
2011-11-17 10:14:36 -08:00
|
|
|
zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_DATASET, "<size>", "WRITTEN", B_FALSE, sfeatures);
|
2013-02-22 01:23:09 -08:00
|
|
|
zprop_register_number(ZFS_PROP_LOGICALUSED, "logicalused", 0,
|
2018-02-08 09:16:23 -07:00
|
|
|
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"LUSED", B_FALSE, sfeatures);
|
2013-02-22 01:23:09 -08:00
|
|
|
zprop_register_number(ZFS_PROP_LOGICALREFERENCED, "logicalreferenced",
|
2019-06-19 09:48:13 -07:00
|
|
|
0, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<size>",
|
2022-02-20 03:07:25 +01:00
|
|
|
"LREFER", B_FALSE, sfeatures);
|
2017-01-23 21:17:35 +03:00
|
|
|
zprop_register_number(ZFS_PROP_FILESYSTEM_COUNT, "filesystem_count",
|
|
|
|
|
UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<count>", "FSCOUNT", B_FALSE, sfeatures);
|
2017-01-23 21:17:35 +03:00
|
|
|
zprop_register_number(ZFS_PROP_SNAPSHOT_COUNT, "snapshot_count",
|
|
|
|
|
UINT64_MAX, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<count>", "SSCOUNT", B_FALSE, sfeatures);
|
2017-05-10 00:36:53 +02:00
|
|
|
zprop_register_number(ZFS_PROP_GUID, "guid", 0, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<uint64>", "GUID",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_TRUE, sfeatures);
|
2017-05-10 00:36:53 +02:00
|
|
|
zprop_register_number(ZFS_PROP_CREATETXG, "createtxg", 0, PROP_READONLY,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "<uint64>", "CREATETXG",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_TRUE, sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_number(ZFS_PROP_PBKDF2_ITERS, "pbkdf2iters",
|
|
|
|
|
0, PROP_ONETIME_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<iters>", "PBKDF2ITERS", B_TRUE, sfeatures);
|
2018-08-20 09:52:37 -07:00
|
|
|
zprop_register_number(ZFS_PROP_OBJSETID, "objsetid", 0,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "<uint64>", "OBJSETID", B_TRUE,
|
|
|
|
|
sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* default number properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "<size> | none", "QUOTA", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_RESERVATION, "reservation", 0,
|
|
|
|
|
PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<size> | none", "RESERV", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_VOLSIZE, "volsize", 0, PROP_DEFAULT,
|
2021-12-17 01:43:10 +01:00
|
|
|
ZFS_TYPE_SNAPSHOT | ZFS_TYPE_VOLUME, "<size>", "VOLSIZE",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_REFQUOTA, "refquota", 0, PROP_DEFAULT,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM, "<size> | none", "REFQUOTA", B_FALSE,
|
|
|
|
|
sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_REFRESERVATION, "refreservation", 0,
|
2008-11-20 12:01:55 -08:00
|
|
|
PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<size> | none", "REFRESERV", B_FALSE, sfeatures);
|
2015-04-02 00:07:48 +11:00
|
|
|
zprop_register_number(ZFS_PROP_FILESYSTEM_LIMIT, "filesystem_limit",
|
|
|
|
|
UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<count> | none", "FSLIMIT", B_FALSE, sfeatures);
|
2015-04-02 00:07:48 +11:00
|
|
|
zprop_register_number(ZFS_PROP_SNAPSHOT_LIMIT, "snapshot_limit",
|
|
|
|
|
UINT64_MAX, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<count> | none", "SSLIMIT", B_FALSE, sfeatures);
|
2025-03-09 21:37:26 +05:00
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTUSERQUOTA, "defaultuserquota", 0,
|
|
|
|
|
PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
|
|
|
|
"<size> | none", "DEFAULTUSERQUOTA", B_FALSE, sfeatures);
|
|
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTGROUPQUOTA, "defaultgroupquota",
|
|
|
|
|
0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT,
|
|
|
|
|
"<size> | none", "DEFAULTGROUPQUOTA", B_FALSE, sfeatures);
|
|
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTPROJECTQUOTA,
|
|
|
|
|
"defaultprojectquota", 0, PROP_DEFAULT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "<size> | none",
|
|
|
|
|
"DEFAULTPROJECTQUOTA", B_FALSE, sfeatures);
|
|
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTUSEROBJQUOTA,
|
|
|
|
|
"defaultuserobjquota", 0, PROP_DEFAULT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "<size> | none",
|
|
|
|
|
"DEFAULTUSEROBJQUOTA", B_FALSE, sfeatures);
|
|
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTGROUPOBJQUOTA,
|
|
|
|
|
"defaultgroupobjquota", 0, PROP_DEFAULT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "<size> | none",
|
|
|
|
|
"DEFAULTGROUPOBJQUOTA", B_FALSE, sfeatures);
|
|
|
|
|
zprop_register_number(ZFS_PROP_DEFAULTPROJECTOBJQUOTA,
|
|
|
|
|
"defaultprojectobjquota", 0, PROP_DEFAULT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, "<size> | none",
|
|
|
|
|
"DEFAULTPROJECTOBJQUOTA", B_FALSE, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* inherit number properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_number(ZFS_PROP_RECORDSIZE, "recordsize",
|
2014-11-03 12:15:08 -08:00
|
|
|
SPA_OLD_MAXBLOCKSIZE, PROP_INHERIT,
|
2025-07-02 14:11:37 -04:00
|
|
|
ZFS_TYPE_FILESYSTEM, "512 to 16M, power of 2",
|
|
|
|
|
"RECSIZE", B_FALSE, sfeatures);
|
2018-09-05 19:33:36 -06:00
|
|
|
zprop_register_number(ZFS_PROP_SPECIAL_SMALL_BLOCKS,
|
2025-05-24 14:44:26 -06:00
|
|
|
"special_small_blocks", 0, PROP_INHERIT,
|
2025-07-02 14:11:37 -04:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "0 to 16M",
|
|
|
|
|
"SPECIAL_SMALL_BLOCKS", B_FALSE, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* hidden properties */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_NUMCLONES, "numclones", PROP_TYPE_NUMBER,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_SNAPSHOT, "NUMCLONES", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_NAME, "name", PROP_TYPE_STRING,
|
2021-12-17 01:43:10 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "NAME",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_TRUE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_ISCSIOPTIONS, "iscsioptions",
|
2021-12-17 01:43:10 +01:00
|
|
|
PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME, "ISCSIOPTIONS",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_TRUE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_STMF_SHAREINFO, "stmf_sbd_lu",
|
2009-07-02 15:44:48 -07:00
|
|
|
PROP_TYPE_STRING, PROP_INHERIT, ZFS_TYPE_VOLUME,
|
2022-02-20 03:07:25 +01:00
|
|
|
"STMF_SBD_LU", B_TRUE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_USERACCOUNTING, "useraccounting",
|
|
|
|
|
PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET,
|
2022-02-20 03:07:25 +01:00
|
|
|
"USERACCOUNTING", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_UNIQUE, "unique", PROP_TYPE_NUMBER,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "UNIQUE", B_FALSE, sfeatures);
|
2013-07-27 10:51:50 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_INCONSISTENT, "inconsistent",
|
2021-12-17 01:43:10 +01:00
|
|
|
PROP_TYPE_NUMBER, PROP_READONLY, ZFS_TYPE_DATASET, "INCONSISTENT",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_FALSE, sfeatures);
|
2019-02-04 14:24:55 -05:00
|
|
|
zprop_register_hidden(ZFS_PROP_IVSET_GUID, "ivsetguid",
|
|
|
|
|
PROP_TYPE_NUMBER, PROP_READONLY,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK, "IVSETGUID", B_TRUE,
|
|
|
|
|
sfeatures);
|
2016-01-01 14:15:31 +01:00
|
|
|
zprop_register_hidden(ZFS_PROP_PREV_SNAP, "prevsnap", PROP_TYPE_STRING,
|
2021-12-17 01:43:10 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PREVSNAP",
|
2022-02-20 03:07:25 +01:00
|
|
|
B_TRUE, sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_hidden(ZFS_PROP_PBKDF2_SALT, "pbkdf2salt",
|
|
|
|
|
PROP_TYPE_NUMBER, PROP_ONETIME_DEFAULT,
|
2022-02-20 03:07:25 +01:00
|
|
|
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "PBKDF2SALT", B_FALSE,
|
|
|
|
|
sfeatures);
|
2017-08-14 13:36:48 -04:00
|
|
|
zprop_register_hidden(ZFS_PROP_KEY_GUID, "keyguid", PROP_TYPE_NUMBER,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "KEYGUID", B_TRUE, sfeatures);
|
2019-06-19 09:48:13 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_REDACTED, "redacted", PROP_TYPE_NUMBER,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "REDACTED", B_FALSE, sfeatures);
|
2010-05-28 13:45:14 -07:00
|
|
|
|
|
|
|
|
/*
|
2019-06-24 16:44:01 -07:00
|
|
|
* Properties that are obsolete and not used. These are retained so
|
|
|
|
|
* that we don't have to change the values of the zfs_prop_t enum, or
|
|
|
|
|
* have NULL pointers in the zfs_prop_table[].
|
2010-05-28 13:45:14 -07:00
|
|
|
*/
|
2019-06-24 16:44:01 -07:00
|
|
|
zprop_register_hidden(ZFS_PROP_REMAPTXG, "remaptxg", PROP_TYPE_NUMBER,
|
2022-02-20 03:07:25 +01:00
|
|
|
PROP_READONLY, ZFS_TYPE_DATASET, "REMAPTXG", B_FALSE, sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/* oddball properties */
|
2022-02-20 03:07:25 +01:00
|
|
|
/* 'creation' is a number but displayed as human-readable => flex */
|
2010-05-28 13:45:14 -07:00
|
|
|
zprop_register_impl(ZFS_PROP_CREATION, "creation", PROP_TYPE_NUMBER, 0,
|
2013-12-11 14:33:41 -08:00
|
|
|
NULL, PROP_READONLY, ZFS_TYPE_DATASET | ZFS_TYPE_BOOKMARK,
|
2022-02-20 03:07:25 +01:00
|
|
|
"<date>", "CREATION", B_FALSE, B_TRUE, B_TRUE, NULL, sfeatures);
|
2021-12-17 01:43:10 +01:00
|
|
|
|
2022-08-03 04:45:30 +05:00
|
|
|
zprop_register_impl(ZFS_PROP_SNAPSHOTS_CHANGED, "snapshots_changed",
|
|
|
|
|
PROP_TYPE_NUMBER, 0, NULL, PROP_READONLY, ZFS_TYPE_FILESYSTEM |
|
|
|
|
|
ZFS_TYPE_VOLUME, "<date>", "SNAPSHOTS_CHANGED", B_FALSE, B_TRUE,
|
|
|
|
|
B_TRUE, NULL, sfeatures);
|
|
|
|
|
|
2021-06-18 08:55:01 +00:00
|
|
|
zprop_register_index(ZFS_PROP_LONGNAME, "longname", 0, PROP_INHERIT,
|
|
|
|
|
ZFS_TYPE_FILESYSTEM, "on | off", "LONGNAME", boolean_table,
|
|
|
|
|
sfeatures);
|
|
|
|
|
|
2021-12-17 01:43:10 +01:00
|
|
|
zfs_mod_list_supported_free(sfeatures);
|
2008-11-20 12:01:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_delegatable(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
zprop_desc_t *pd = &zfs_prop_table[prop];
|
2010-05-28 13:45:14 -07:00
|
|
|
|
|
|
|
|
/* The mlslabel property is never delegatable. */
|
|
|
|
|
if (prop == ZFS_PROP_MLSLABEL)
|
|
|
|
|
return (B_FALSE);
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
return (pd->pd_attr != PROP_READONLY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Given a zfs dataset property name, returns the corresponding property ID.
|
|
|
|
|
*/
|
|
|
|
|
zfs_prop_t
|
|
|
|
|
zfs_name_to_prop(const char *propname)
|
|
|
|
|
{
|
|
|
|
|
return (zprop_name_to_prop(propname, ZFS_TYPE_DATASET));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns true if this is a valid user-defined property (one with a ':').
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_user(const char *name)
|
|
|
|
|
{
|
2024-10-02 21:40:06 +05:30
|
|
|
int i, len;
|
2008-11-20 12:01:55 -08:00
|
|
|
char c;
|
|
|
|
|
boolean_t foundsep = B_FALSE;
|
|
|
|
|
|
2024-10-02 21:40:06 +05:30
|
|
|
len = strlen(name);
|
|
|
|
|
for (i = 0; i < len; i++) {
|
2008-11-20 12:01:55 -08:00
|
|
|
c = name[i];
|
2021-11-30 09:46:25 -05:00
|
|
|
if (!zprop_valid_char(c))
|
2008-11-20 12:01:55 -08:00
|
|
|
return (B_FALSE);
|
|
|
|
|
if (c == ':')
|
|
|
|
|
foundsep = B_TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!foundsep)
|
|
|
|
|
return (B_FALSE);
|
|
|
|
|
|
|
|
|
|
return (B_TRUE);
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-02 15:44:48 -07:00
|
|
|
/*
|
|
|
|
|
* Returns true if this is a valid userspace-type property (one with a '@').
|
|
|
|
|
* Note that after the @, any character is valid (eg, another @, for SID
|
|
|
|
|
* user@domain).
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_userquota(const char *name)
|
|
|
|
|
{
|
|
|
|
|
zfs_userquota_prop_t prop;
|
|
|
|
|
|
|
|
|
|
for (prop = 0; prop < ZFS_NUM_USERQUOTA_PROPS; prop++) {
|
|
|
|
|
if (strncmp(name, zfs_userquota_prop_prefixes[prop],
|
|
|
|
|
strlen(zfs_userquota_prop_prefixes[prop])) == 0) {
|
|
|
|
|
return (B_TRUE);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (B_FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
2011-11-17 10:14:36 -08:00
|
|
|
/*
|
|
|
|
|
* Returns true if this is a valid written@ property.
|
|
|
|
|
* Note that after the @, any character is valid (eg, another @, for
|
|
|
|
|
* written@pool/fs@origin).
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_written(const char *name)
|
|
|
|
|
{
|
2019-06-19 09:48:13 -07:00
|
|
|
static const char *prop_prefix = "written@";
|
|
|
|
|
static const char *book_prefix = "written#";
|
|
|
|
|
return (strncmp(name, prop_prefix, strlen(prop_prefix)) == 0 ||
|
|
|
|
|
strncmp(name, book_prefix, strlen(book_prefix)) == 0);
|
2011-11-17 10:14:36 -08:00
|
|
|
}
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
/*
|
|
|
|
|
* Tables of index types, plus functions to convert between the user view
|
|
|
|
|
* (strings) and internal representation (uint64_t).
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
zfs_prop_string_to_index(zfs_prop_t prop, const char *string, uint64_t *index)
|
|
|
|
|
{
|
|
|
|
|
return (zprop_string_to_index(prop, string, index, ZFS_TYPE_DATASET));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
zfs_prop_index_to_string(zfs_prop_t prop, uint64_t index, const char **string)
|
|
|
|
|
{
|
|
|
|
|
return (zprop_index_to_string(prop, index, string, ZFS_TYPE_DATASET));
|
|
|
|
|
}
|
|
|
|
|
|
2010-05-28 13:45:14 -07:00
|
|
|
uint64_t
|
|
|
|
|
zfs_prop_random_value(zfs_prop_t prop, uint64_t seed)
|
|
|
|
|
{
|
|
|
|
|
return (zprop_random_value(prop, seed, ZFS_TYPE_DATASET));
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
/*
|
|
|
|
|
* Returns TRUE if the property applies to any of the given dataset types.
|
|
|
|
|
*/
|
2008-12-03 12:09:06 -08:00
|
|
|
boolean_t
|
2014-04-21 13:22:08 -05:00
|
|
|
zfs_prop_valid_for_type(int prop, zfs_type_t types, boolean_t headcheck)
|
2008-11-20 12:01:55 -08:00
|
|
|
{
|
2014-04-21 13:22:08 -05:00
|
|
|
return (zprop_valid_for_type(prop, types, headcheck));
|
2008-11-20 12:01:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
zprop_type_t
|
|
|
|
|
zfs_prop_get_type(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_proptype);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns TRUE if the property is readonly.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_readonly(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_attr == PROP_READONLY ||
|
2017-08-14 13:36:48 -04:00
|
|
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
|
|
|
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
2008-11-20 12:01:55 -08:00
|
|
|
}
|
|
|
|
|
|
2018-02-08 09:16:23 -07:00
|
|
|
/*
|
|
|
|
|
* Returns TRUE if the property is visible (not hidden).
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_visible(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2018-09-02 15:09:53 -04:00
|
|
|
return (zfs_prop_table[prop].pd_visible &&
|
|
|
|
|
zfs_prop_table[prop].pd_zfs_mod_supported);
|
2018-02-08 09:16:23 -07:00
|
|
|
}
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
/*
|
|
|
|
|
* Returns TRUE if the property is only allowed to be set once.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_setonce(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2017-08-14 13:36:48 -04:00
|
|
|
return (zfs_prop_table[prop].pd_attr == PROP_ONETIME ||
|
|
|
|
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME_DEFAULT);
|
2008-11-20 12:01:55 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const char *
|
|
|
|
|
zfs_prop_default_string(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_strdefault);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint64_t
|
|
|
|
|
zfs_prop_default_numeric(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_numdefault);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Given a dataset property ID, returns the corresponding name.
|
|
|
|
|
* Assuming the zfs dataset property ID is valid.
|
|
|
|
|
*/
|
|
|
|
|
const char *
|
|
|
|
|
zfs_prop_to_name(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_name);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns TRUE if the property is inheritable.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_inheritable(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_attr == PROP_INHERIT ||
|
|
|
|
|
zfs_prop_table[prop].pd_attr == PROP_ONETIME);
|
|
|
|
|
}
|
|
|
|
|
|
2017-08-14 13:36:48 -04:00
|
|
|
/*
|
|
|
|
|
* Returns TRUE if property is one of the encryption properties that requires
|
|
|
|
|
* a loaded encryption key to modify.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_encryption_key_param(zfs_prop_t prop)
|
|
|
|
|
{
|
|
|
|
|
/*
|
|
|
|
|
* keylocation does not count as an encryption property. It can be
|
|
|
|
|
* changed at will without needing the master keys.
|
|
|
|
|
*/
|
|
|
|
|
return (prop == ZFS_PROP_PBKDF2_SALT || prop == ZFS_PROP_PBKDF2_ITERS ||
|
|
|
|
|
prop == ZFS_PROP_KEYFORMAT);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Helper function used by both kernelspace and userspace to check the
|
|
|
|
|
* keylocation property. If encrypted is set, the keylocation must be valid
|
|
|
|
|
* for an encrypted dataset.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_valid_keylocation(const char *str, boolean_t encrypted)
|
|
|
|
|
{
|
|
|
|
|
if (strcmp("none", str) == 0)
|
|
|
|
|
return (!encrypted);
|
|
|
|
|
else if (strcmp("prompt", str) == 0)
|
|
|
|
|
return (B_TRUE);
|
|
|
|
|
else if (strlen(str) > 8 && strncmp("file:///", str, 8) == 0)
|
|
|
|
|
return (B_TRUE);
|
2021-05-13 06:21:35 +02:00
|
|
|
else if (strlen(str) > 8 && strncmp("https://", str, 8) == 0)
|
|
|
|
|
return (B_TRUE);
|
|
|
|
|
else if (strlen(str) > 7 && strncmp("http://", str, 7) == 0)
|
|
|
|
|
return (B_TRUE);
|
2017-08-14 13:36:48 -04:00
|
|
|
|
|
|
|
|
return (B_FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2008-11-20 12:01:55 -08:00
|
|
|
#ifndef _KERNEL
|
2020-06-11 16:25:39 -04:00
|
|
|
#include <libzfs.h>
|
2008-11-20 12:01:55 -08:00
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns a string describing the set of acceptable values for the given
|
|
|
|
|
* zfs property, or NULL if it cannot be set.
|
|
|
|
|
*/
|
|
|
|
|
const char *
|
|
|
|
|
zfs_prop_values(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_values);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns TRUE if this property is a string type. Note that index types
|
|
|
|
|
* (compression, checksum) are treated as strings in userland, even though they
|
|
|
|
|
* are stored numerically on disk.
|
|
|
|
|
*/
|
|
|
|
|
int
|
|
|
|
|
zfs_prop_is_string(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_proptype == PROP_TYPE_STRING ||
|
|
|
|
|
zfs_prop_table[prop].pd_proptype == PROP_TYPE_INDEX);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns the column header for the given property. Used only in
|
|
|
|
|
* 'zfs list -o', but centralized here with the other property information.
|
|
|
|
|
*/
|
|
|
|
|
const char *
|
|
|
|
|
zfs_prop_column_name(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_colname);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Returns whether the given property should be displayed right-justified for
|
|
|
|
|
* 'zfs list'.
|
|
|
|
|
*/
|
|
|
|
|
boolean_t
|
|
|
|
|
zfs_prop_align_right(zfs_prop_t prop)
|
|
|
|
|
{
|
2022-11-09 04:16:01 +10:00
|
|
|
ASSERT3S(prop, >=, 0);
|
|
|
|
|
ASSERT3S(prop, <, ZFS_NUM_PROPS);
|
2008-11-20 12:01:55 -08:00
|
|
|
return (zfs_prop_table[prop].pd_rightalign);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
2010-08-26 11:49:16 -07:00
|
|
|
|
2018-02-15 17:53:18 -08:00
|
|
|
#if defined(_KERNEL)
|
2019-10-24 10:17:33 -07:00
|
|
|
|
2022-03-09 01:19:15 +01:00
|
|
|
#if defined(HAVE_KERNEL_FPU_INTERNAL)
|
|
|
|
|
uint8_t **zfs_kfpu_fpregs;
|
2019-10-24 10:17:33 -07:00
|
|
|
EXPORT_SYMBOL(zfs_kfpu_fpregs);
|
2022-03-09 01:19:15 +01:00
|
|
|
#endif /* defined(HAVE_KERNEL_FPU_INTERNAL) */
|
2019-10-24 10:17:33 -07:00
|
|
|
|
2022-03-31 17:20:50 +02:00
|
|
|
extern int __init zcommon_init(void);
|
|
|
|
|
extern void zcommon_fini(void);
|
|
|
|
|
|
|
|
|
|
int __init
|
2015-02-18 15:39:05 -08:00
|
|
|
zcommon_init(void)
|
|
|
|
|
{
|
2019-10-24 10:17:33 -07:00
|
|
|
int error = kfpu_init();
|
|
|
|
|
if (error)
|
|
|
|
|
return (error);
|
|
|
|
|
|
2015-12-09 15:34:16 -08:00
|
|
|
fletcher_4_init();
|
2024-09-20 11:16:44 -04:00
|
|
|
simd_stat_init();
|
2019-10-24 10:17:33 -07:00
|
|
|
|
2015-02-18 15:39:05 -08:00
|
|
|
return (0);
|
|
|
|
|
}
|
2010-08-26 11:49:16 -07:00
|
|
|
|
2022-03-31 17:20:50 +02:00
|
|
|
void
|
2015-02-18 15:39:05 -08:00
|
|
|
zcommon_fini(void)
|
|
|
|
|
{
|
2024-09-20 11:16:44 -04:00
|
|
|
simd_stat_fini();
|
2015-12-09 15:34:16 -08:00
|
|
|
fletcher_4_fini();
|
2019-10-24 10:17:33 -07:00
|
|
|
kfpu_fini();
|
2015-02-18 15:39:05 -08:00
|
|
|
}
|
2010-08-26 11:49:16 -07:00
|
|
|
|
2022-03-31 17:20:50 +02:00
|
|
|
#ifdef __FreeBSD__
|
2020-12-10 00:29:00 -05:00
|
|
|
module_init_early(zcommon_init);
|
2015-02-18 15:39:05 -08:00
|
|
|
module_exit(zcommon_fini);
|
2019-11-01 10:41:03 -07:00
|
|
|
#endif
|
|
|
|
|
|
2022-03-31 17:20:50 +02:00
|
|
|
#endif
|
2010-08-26 11:49:16 -07:00
|
|
|
|
|
|
|
|
/* zfs dataset property functions */
|
|
|
|
|
EXPORT_SYMBOL(zfs_userquota_prop_prefixes);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_init);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_get_type);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_get_table);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_delegatable);
|
2018-02-08 09:16:23 -07:00
|
|
|
EXPORT_SYMBOL(zfs_prop_visible);
|
2010-08-26 11:49:16 -07:00
|
|
|
|
|
|
|
|
/* Dataset property functions shared between libzfs and kernel. */
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_default_string);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_default_numeric);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_readonly);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_inheritable);
|
2017-08-14 13:36:48 -04:00
|
|
|
EXPORT_SYMBOL(zfs_prop_encryption_key_param);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_valid_keylocation);
|
2010-08-26 11:49:16 -07:00
|
|
|
EXPORT_SYMBOL(zfs_prop_setonce);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_to_name);
|
|
|
|
|
EXPORT_SYMBOL(zfs_name_to_prop);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_user);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_userquota);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_index_to_string);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_string_to_index);
|
|
|
|
|
EXPORT_SYMBOL(zfs_prop_valid_for_type);
|
2018-02-08 09:16:23 -07:00
|
|
|
EXPORT_SYMBOL(zfs_prop_written);
|