Print this page
NEX-9406 Add a property to show that a dataset has been modified since a snapshot
Reviewed by: Alexey Komarov <alexey.komarov@nexenta.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Fixup merge results
re #12585 rb4049 ZFS++ work port - refactoring to improve separation of open/closed code, bug fixes, performance improvements - open code
Bug 11205: add missing libzfs_closed_stubs.c to fix opensource-only build.
ZFS plus work: special vdevs, cos, cos/vdev properties
        
@@ -19,13 +19,12 @@
  * CDDL HEADER END
  */
 /*
  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
- */
-/*
  * Copyright (c) 2012 by Delphix. All rights reserved.
+ * Copyright 2017 Nexenta Systems, Inc. All rights reserved.
  */
 
 /*
  * Common routines used by zfs and zpool property management.
  */
@@ -50,23 +49,35 @@
 #endif
 
 static zprop_desc_t *
 zprop_get_proptable(zfs_type_t type)
 {
-        if (type == ZFS_TYPE_POOL)
+        switch (type) {
+        case ZFS_TYPE_POOL:
                 return (zpool_prop_get_table());
-        else
+        case ZFS_TYPE_VDEV:
+                return (vdev_prop_get_table());
+        case ZFS_TYPE_COS:
+                return (cos_prop_get_table());
+        default:
                 return (zfs_prop_get_table());
+        }
 }
 
 static int
 zprop_get_numprops(zfs_type_t type)
 {
-        if (type == ZFS_TYPE_POOL)
+        switch (type) {
+        case ZFS_TYPE_POOL:
                 return (ZPOOL_NUM_PROPS);
-        else
+        case ZFS_TYPE_VDEV:
+                return (VDEV_NUM_PROPS);
+        case ZFS_TYPE_COS:
+                return (COS_NUM_PROPS);
+        default:
                 return (ZFS_NUM_PROPS);
+        }
 }
 
 void
 zprop_register_impl(int prop, const char *name, zprop_type_t type,
     uint64_t numdefault, const char *strdefault, zprop_attr_t attr,
@@ -125,10 +136,20 @@
 {
         zprop_register_impl(prop, name, PROP_TYPE_INDEX, def, NULL, attr,
             objset_types, values, colname, B_TRUE, B_TRUE, idx_tbl);
 }
 
+/* Same as zprop_register_index, except the property is hidden */
+void
+zprop_register_index_hidden(int prop, const char *name, uint64_t def,
+    zprop_attr_t attr, int objset_types, const char *values,
+    const char *colname, const zprop_index_t *idx_tbl)
+{
+        zprop_register_impl(prop, name, PROP_TYPE_INDEX, def, NULL, attr,
+            objset_types, values, colname, B_TRUE, B_FALSE, idx_tbl);
+}
+
 void
 zprop_register_hidden(int prop, const char *name, zprop_type_t type,
     zprop_attr_t attr, int objset_types, const char *colname)
 {
         zprop_register_impl(prop, name, type, 0, NULL, attr,