summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLOLi <[email protected]>2017-07-12 22:05:37 +0200
committerBrian Behlendorf <[email protected]>2017-07-12 13:05:37 -0700
commitcf8738d85374f51298a0872bcd58257bbb4fda6d (patch)
tree213e94c15f61f569836e7e0f0fb40727e8cdd4f9 /include
parente19572e4cc0b8df95ebf60053029e454592a92d4 (diff)
Add port of FreeBSD 'volmode' property
The volmode property may be set to control the visibility of ZVOL block devices. This allow switching ZVOL between three modes: full - existing fully functional behaviour (default) dev - hide partitions on ZVOL block devices none - not exposing volumes outside ZFS Additionally the new zvol_volmode module parameter can be used to control the default behaviour. This functionality can be used, for instance, on "backup" pools to avoid cluttering /dev with unneeded zd* devices. Original-patch-by: mav <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Ported-by: loli10K <[email protected]> Signed-off-by: loli10K <[email protected]> FreeBSD-commit: https://github.com/freebsd/freebsd/commit/dd28e6bb Closes #1796 Closes #3438 Closes #6233
Diffstat (limited to 'include')
-rw-r--r--include/sys/fs/zfs.h8
-rw-r--r--include/sys/zvol.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index 0ce35468f..b634635c8 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -154,6 +154,7 @@ typedef enum {
ZFS_PROP_LOGICALUSED,
ZFS_PROP_LOGICALREFERENCED,
ZFS_PROP_INCONSISTENT, /* not exposed to the user */
+ ZFS_PROP_VOLMODE,
ZFS_PROP_FILESYSTEM_LIMIT,
ZFS_PROP_SNAPSHOT_LIMIT,
ZFS_PROP_FILESYSTEM_COUNT,
@@ -394,6 +395,13 @@ typedef enum {
ZFS_REDUNDANT_METADATA_MOST
} zfs_redundant_metadata_type_t;
+typedef enum {
+ ZFS_VOLMODE_DEFAULT = 0,
+ ZFS_VOLMODE_GEOM = 1,
+ ZFS_VOLMODE_DEV = 2,
+ ZFS_VOLMODE_NONE = 3
+} zfs_volmode_t;
+
/*
* On-disk version number.
*/
diff --git a/include/sys/zvol.h b/include/sys/zvol.h
index f149da977..e8b084762 100644
--- a/include/sys/zvol.h
+++ b/include/sys/zvol.h
@@ -51,6 +51,7 @@ extern void zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx);
extern int zvol_set_volsize(const char *, uint64_t);
extern int zvol_set_volblocksize(const char *, uint64_t);
extern int zvol_set_snapdev(const char *, zprop_source_t, uint64_t);
+extern int zvol_set_volmode(const char *, zprop_source_t, uint64_t);
extern zvol_state_t *zvol_suspend(const char *);
extern int zvol_resume(zvol_state_t *);
extern void *zvol_tag(zvol_state_t *);