mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 02:44:41 +03:00
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 <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Ported-by: loli10K <ezomori.nozomu@gmail.com> Signed-off-by: loli10K <ezomori.nozomu@gmail.com> FreeBSD-commit: https://github.com/freebsd/freebsd/commit/dd28e6bb Closes #1796 Closes #3438 Closes #6233
This commit is contained in:
@@ -245,6 +245,15 @@ zfs_prop_init(void)
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
static zprop_index_t volmode_table[] = {
|
||||
{ "default", ZFS_VOLMODE_DEFAULT },
|
||||
{ "full", ZFS_VOLMODE_GEOM },
|
||||
{ "geom", ZFS_VOLMODE_GEOM },
|
||||
{ "dev", ZFS_VOLMODE_DEV },
|
||||
{ "none", ZFS_VOLMODE_NONE },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
/* inherit index properties */
|
||||
zprop_register_index(ZFS_PROP_REDUNDANT_METADATA, "redundant_metadata",
|
||||
ZFS_REDUNDANT_METADATA_ALL,
|
||||
@@ -302,6 +311,10 @@ zfs_prop_init(void)
|
||||
zprop_register_index(ZFS_PROP_DNODESIZE, "dnodesize",
|
||||
ZFS_DNSIZE_LEGACY, PROP_INHERIT, ZFS_TYPE_FILESYSTEM,
|
||||
"legacy | auto | 1k | 2k | 4k | 8k | 16k", "DNSIZE", dnsize_table);
|
||||
zprop_register_index(ZFS_PROP_VOLMODE, "volmode",
|
||||
ZFS_VOLMODE_DEFAULT, PROP_INHERIT,
|
||||
ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME,
|
||||
"default | full | geom | dev | none", "VOLMODE", volmode_table);
|
||||
|
||||
/* inherit index (boolean) properties */
|
||||
zprop_register_index(ZFS_PROP_ATIME, "atime", 1, PROP_INHERIT,
|
||||
|
||||
Reference in New Issue
Block a user