diff options
author | mm <mm@FreeBSD.org> | 2011-11-28 21:40:00 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2011-11-28 21:40:00 +0000 |
commit | 73cab7197174153a718dedc97ff344341bcf6098 (patch) | |
tree | 77fe89756134ff0449a9b13c294d9097b13f8db5 /sys/cddl/contrib/opensolaris/common | |
parent | 72bf877ee7fec77d840c6cdf8e327dfcbe244e6e (diff) | |
download | FreeBSD-src-73cab7197174153a718dedc97ff344341bcf6098.zip FreeBSD-src-73cab7197174153a718dedc97ff344341bcf6098.tar.gz |
Merge new ZFS features from illumos:
1644 add ZFS "clones" property
https://www.illumos.org/issues/1644
1645 add ZFS "written" and "written@..." properties
https://www.illumos.org/issues/1645
1646 "zfs send" should estimate size of stream
https://www.illumos.org/issues/1646
1647 "zfs destroy" should determine space reclaimed by destroying multiple
snapshots
https://www.illumos.org/issues/1647
1693 persistent 'comment' field for a zpool
https://www.illumos.org/issues/1693
1708 adjust size of zpool history data
https://www.illumos.org/issues/1708
1748 desire support for reguid in zfs
https://www.illumos.org/issues/1748
Obtained from: illumos (changesets 13514, 13524, 13525)
MFC after: 1 month
Diffstat (limited to 'sys/cddl/contrib/opensolaris/common')
-rw-r--r-- | sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c | 18 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h | 2 | ||||
-rw-r--r-- | sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c | 4 |
3 files changed, 23 insertions, 1 deletions
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c index baa5e49..398963a 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c @@ -267,7 +267,7 @@ zfs_prop_init(void) /* default index properties */ zprop_register_index(ZFS_PROP_VERSION, "version", 0, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT, - "1 | 2 | 3 | 4 | current", "VERSION", version_table); + "1 | 2 | 3 | 4 | 5 | current", "VERSION", version_table); zprop_register_index(ZFS_PROP_CANMOUNT, "canmount", ZFS_CANMOUNT_ON, PROP_DEFAULT, ZFS_TYPE_FILESYSTEM, "on | off | noauto", "CANMOUNT", canmount_table); @@ -297,6 +297,8 @@ zfs_prop_init(void) /* string properties */ zprop_register_string(ZFS_PROP_ORIGIN, "origin", NULL, PROP_READONLY, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<snapshot>", "ORIGIN"); + zprop_register_string(ZFS_PROP_CLONES, "clones", NULL, PROP_READONLY, + ZFS_TYPE_SNAPSHOT, "<dataset>[,...]", "CLONES"); zprop_register_string(ZFS_PROP_MOUNTPOINT, "mountpoint", "/", PROP_INHERIT, ZFS_TYPE_FILESYSTEM, "<path> | legacy | none", "MOUNTPOINT"); @@ -342,6 +344,8 @@ zfs_prop_init(void) ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME, "<size>", "USEDREFRESERV"); zprop_register_number(ZFS_PROP_USERREFS, "userrefs", 0, PROP_READONLY, ZFS_TYPE_SNAPSHOT, "<count>", "USERREFS"); + zprop_register_number(ZFS_PROP_WRITTEN, "written", 0, PROP_READONLY, + ZFS_TYPE_DATASET, "<size>", "WRITTEN"); /* default number properties */ zprop_register_number(ZFS_PROP_QUOTA, "quota", 0, PROP_DEFAULT, @@ -468,6 +472,18 @@ zfs_prop_userquota(const char *name) } /* + * 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) +{ + static const char *prefix = "written@"; + return (strncmp(name, prefix, strlen(prefix)) == 0); +} + +/* * Tables of index types, plus functions to convert between the user view * (strings) and internal representation (uint64_t). */ diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h index a632623..e604abd 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h @@ -121,6 +121,8 @@ uint64_t zprop_random_value(int, uint64_t, zfs_type_t); const char *zprop_values(int, zfs_type_t); size_t zprop_width(int, boolean_t *, zfs_type_t); boolean_t zprop_valid_for_type(int, zfs_type_t); +boolean_t zfs_prop_written(const char *name); + #ifdef __cplusplus } diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c b/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c index 988d05d..add5bfb 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c @@ -20,6 +20,8 @@ */ /* * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2011 by Delphix. All rights reserved. */ #include <sys/zio.h> @@ -69,6 +71,8 @@ zpool_prop_init(void) ZFS_TYPE_POOL, "<filesystem>", "BOOTFS"); zprop_register_string(ZPOOL_PROP_CACHEFILE, "cachefile", NULL, PROP_DEFAULT, ZFS_TYPE_POOL, "<file> | none", "CACHEFILE"); + zprop_register_string(ZPOOL_PROP_COMMENT, "comment", NULL, + PROP_DEFAULT, ZFS_TYPE_POOL, "<comment-string>", "COMMENT"); /* readonly number properties */ zprop_register_number(ZPOOL_PROP_SIZE, "size", 0, PROP_READONLY, |