diff options
author | mm <mm@FreeBSD.org> | 2013-03-17 10:57:04 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-03-17 10:57:04 +0000 |
commit | 6c7511b96eb323641755bcec17f25f6f6f220a35 (patch) | |
tree | 40daf53539cb7fa1f1f9d3393c67ff6457a692bf /cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h | |
parent | b9a4266c5c62b694f294026dcd9c7d02b41da67e (diff) | |
download | FreeBSD-src-6c7511b96eb323641755bcec17f25f6f6f220a35.zip FreeBSD-src-6c7511b96eb323641755bcec17f25f6f6f220a35.tar.gz |
libzfs_core:
- provide complete backwards compatibility (old utility, new kernel)
- add zfs_cmd_t compatibility mapping in both directions
- determine ioctl address in zfs_ioctl_compat.c
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h')
-rw-r--r-- | cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h index b6654b4..881737d 100644 --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_compat.h @@ -43,18 +43,18 @@ static int zfs_ioctl_version = 0; static __inline int zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) { - unsigned long cmd; size_t oldsize, zfs_kernel_version_size, zfs_ioctl_version_size; int version, ret, cflag = ZFS_CMD_COMPAT_NONE; - cmd = _IOWR('Z', request, struct zfs_cmd); - zfs_ioctl_version_size = sizeof(zfs_ioctl_version); if (zfs_ioctl_version == 0) { sysctlbyname("vfs.zfs.version.ioctl", &zfs_ioctl_version, &zfs_ioctl_version_size, NULL, 0); } + if (zfs_ioctl_version == ZFS_IOCVER_DEADMAN) + cflag = ZFS_CMD_COMPAT_DEADMAN; + /* * If vfs.zfs.version.ioctl is not defined, assume we have v28 * compatible binaries and use vfs.zfs.version.spa to test for v15 @@ -76,7 +76,7 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) } oldsize = zc->zc_nvlist_dst_size; - ret = zcmd_ioctl_compat(fd, cmd, zc, cflag); + ret = zcmd_ioctl_compat(fd, request, zc, cflag); if (ret == 0 && oldsize < zc->zc_nvlist_dst_size) { ret = -1; @@ -85,7 +85,7 @@ zcmd_ioctl(int fd, int request, zfs_cmd_t *zc) return (ret); } -#define ioctl(fd, cmd, zc) zcmd_ioctl((fd), (cmd), (zc)) +#define ioctl(fd, ioc, zc) zcmd_ioctl((fd), (ioc), (zc)) #ifdef __cplusplus } |