aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDon Brady <[email protected]>2018-09-02 15:09:53 -0400
committerBrian Behlendorf <[email protected]>2018-09-02 12:09:53 -0700
commite8bcb693d6a19962291e4429f2dc4ce60693bef7 (patch)
treea4afbb8d0562aae23e9fd8fd561fd2182b14db8e /lib
parentbb91178e60df553071ce2e18b0067ef703f7b583 (diff)
Add zfs module feature and property info to sysfs
This extends our sysfs '/sys/module/zfs' entry to include feature and property attributes. The primary consumer of this information is user processes, like the zfs CLI, that need to know what the current loaded ZFS module supports. The libzfs binary will consult this information when instantiating the zfs and zpool property tables and the pool features table. This introduces 4 kernel objects (dirs) into '/sys/module/zfs' with corresponding attributes (files): features.runtime features.pool properties.dataset properties.pool Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Don Brady <[email protected]> Closes #7706
Diffstat (limited to 'lib')
-rw-r--r--lib/libzfs/libzfs_util.c16
-rw-r--r--lib/libzpool/Makefile.am2
2 files changed, 18 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_util.c b/lib/libzfs/libzfs_util.c
index a19b34415..d18b582c6 100644
--- a/lib/libzfs/libzfs_util.c
+++ b/lib/libzfs/libzfs_util.c
@@ -1091,6 +1091,22 @@ libzfs_init(void)
hdl->libzfs_prop_debug = B_TRUE;
}
+ /*
+ * For testing, remove some settable properties and features
+ */
+ if (libzfs_envvar_is_set("ZFS_SYSFS_PROP_SUPPORT_TEST")) {
+ zprop_desc_t *proptbl;
+
+ proptbl = zpool_prop_get_table();
+ proptbl[ZPOOL_PROP_COMMENT].pd_zfs_mod_supported = B_FALSE;
+
+ proptbl = zfs_prop_get_table();
+ proptbl[ZFS_PROP_DNODESIZE].pd_zfs_mod_supported = B_FALSE;
+
+ zfeature_info_t *ftbl = spa_feature_table;
+ ftbl[SPA_FEATURE_LARGE_BLOCKS].fi_zfs_mod_supported = B_FALSE;
+ }
+
return (hdl);
}
diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am
index 58e3b6eec..149706a27 100644
--- a/lib/libzpool/Makefile.am
+++ b/lib/libzpool/Makefile.am
@@ -12,6 +12,8 @@ AM_CFLAGS += $(NO_UNUSED_BUT_SET_VARIABLE)
# Includes kernel code generate warnings for large stack frames
AM_CFLAGS += $(FRAME_LARGER_THAN)
+AM_CFLAGS += -DLIB_ZPOOL_BUILD
+
DEFAULT_INCLUDES += \
-I$(top_srcdir)/include \
-I$(top_srcdir)/lib/libspl/include