summaryrefslogtreecommitdiffstats
path: root/include/sys
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-12-06 14:20:22 -0800
committerBrian Behlendorf <[email protected]>2013-12-16 09:15:57 -0800
commitba6a24026c6eb910188c24b5c921fb793d3c998e (patch)
tree65b71e719840b17406f217b2245daa087aa40c15 /include/sys
parentdda12da9f1ec714af0e468aa03c24f402961f135 (diff)
Remove ZFC_IOC_*_MINOR ioctl()s
Early versions of ZFS coordinated the creation and destruction of device minors from userspace. This was inherently racy and in late 2009 these ioctl()s were removed leaving everything up to the kernel. This significantly simplified the code. However, we never picked up these changes in ZoL since we'd already significantly adjusted this code for Linux. This patch aims to rectify that by finally removing ZFC_IOC_*_MINOR ioctl()s and moving all the functionality down in to the kernel. Since this cleanup will change the kernel/user ABI it's being done in the same tag as the previous libzfs_core ABI changes. This will minimize, but not eliminate, the disruption to end users. Once merged ZoL, Illumos, and FreeBSD will basically be back in sync in regards to handling ZVOLs in the common code. While each platform must have its own custom zvol.c implemenation the interfaces provided are consistent. NOTES: 1) This patch introduces one subtle change in behavior which could not be easily avoided. Prior to this change callers of 'zfs create -V ...' were guaranteed that upon exit the /dev/zvol/ block device link would be created or an error returned. That's no longer the case. The utilities will no longer block waiting for the symlink to be created. Callers are now responsible for blocking, this is why a 'udev_wait' call was added to the 'label' function in scripts/common.sh. 2) The read-only behavior of a ZVOL now solely depends on if the ZVOL_RDONLY bit is set in zv->zv_flags. The redundant policy setting in the gendisk structure was removed. This both simplifies the code and allows us to safely leverage set_disk_ro() to issue a KOBJ_CHANGE uevent. See the comment in the code for futher details on this. 3) Because __zvol_create_minor() and zvol_alloc() may now be called in a sync task they must use KM_PUSHPAGE. References: illumos/illumos-gate@681d9761e8516a7dc5ab6589e2dfe717777e1123 Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Ned Bass <[email protected]> Signed-off-by: Tim Chase <[email protected]> Closes #1969
Diffstat (limited to 'include/sys')
-rw-r--r--include/sys/fs/zfs.h2
-rw-r--r--include/sys/zfs_ioctl.h2
-rw-r--r--include/sys/zvol.h9
3 files changed, 7 insertions, 6 deletions
diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h
index e945b40a9..08076bc09 100644
--- a/include/sys/fs/zfs.h
+++ b/include/sys/fs/zfs.h
@@ -793,8 +793,6 @@ typedef enum zfs_ioc {
ZFS_IOC_DATASET_LIST_NEXT,
ZFS_IOC_SNAPSHOT_LIST_NEXT,
ZFS_IOC_SET_PROP,
- ZFS_IOC_CREATE_MINOR,
- ZFS_IOC_REMOVE_MINOR,
ZFS_IOC_CREATE,
ZFS_IOC_DESTROY,
ZFS_IOC_ROLLBACK,
diff --git a/include/sys/zfs_ioctl.h b/include/sys/zfs_ioctl.h
index 4a717b7d1..52557d210 100644
--- a/include/sys/zfs_ioctl.h
+++ b/include/sys/zfs_ioctl.h
@@ -359,6 +359,8 @@ extern int zfs_secpolicy_destroy_perms(const char *name, cred_t *cr);
extern int zfs_unmount_snap(const char *);
extern void zfs_destroy_unmount_origin(const char *);
+extern boolean_t dataset_name_hidden(const char *name);
+
enum zfsdev_state_type {
ZST_ONEXIT,
ZST_ZEVENT,
diff --git a/include/sys/zvol.h b/include/sys/zvol.h
index 640538c2c..04e099657 100644
--- a/include/sys/zvol.h
+++ b/include/sys/zvol.h
@@ -38,10 +38,11 @@ extern int zvol_check_volblocksize(uint64_t volblocksize);
extern int zvol_get_stats(objset_t *os, nvlist_t *nv);
extern boolean_t zvol_is_zvol(const char *);
extern void zvol_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx);
-extern int zvol_create_minor(const char *);
-extern int zvol_create_minors(char *);
-extern int zvol_remove_minor(const char *);
-extern void zvol_remove_minors(const char *);
+extern int zvol_create_minor(const char *name);
+extern int zvol_create_minors(const char *name);
+extern int zvol_remove_minor(const char *name);
+extern void zvol_remove_minors(const char *name);
+extern void zvol_rename_minors(const char *oldname, const char *newname);
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 *, uint64_t);