diff options
author | mm <mm@FreeBSD.org> | 2013-03-05 08:09:53 +0000 |
---|---|---|
committer | mm <mm@FreeBSD.org> | 2013-03-05 08:09:53 +0000 |
commit | 99f883783c89d10b9d02e77393eb9d0a307f3ca0 (patch) | |
tree | 669ea5740806cbf29b6e064275d3f5a62478bd47 /sys/cddl/contrib/opensolaris/common | |
parent | 712512f2cc075f7890eaf59c6aa392f330857ff9 (diff) | |
parent | d5063724619a16bd1592c39395c787e97be18693 (diff) | |
download | FreeBSD-src-99f883783c89d10b9d02e77393eb9d0a307f3ca0.zip FreeBSD-src-99f883783c89d10b9d02e77393eb9d0a307f3ca0.tar.gz |
WiP merge of libzfs_core (MFV r238590, r238592)
not yet working, ioctl handling needs to be changed
Diffstat (limited to 'sys/cddl/contrib/opensolaris/common')
5 files changed, 19 insertions, 6 deletions
diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c index 5df6876..f7bde48 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ /* @@ -156,7 +157,11 @@ zfs_spa_version_map(int zpl_version) return (version); } -const char *zfs_history_event_names[LOG_END] = { +/* + * This is the table of legacy internal event names; it should not be modified. + * The internal events are now stored in the history log as strings. + */ +const char *zfs_history_event_names[ZFS_NUM_LEGACY_HISTORY_EVENTS] = { "invalid event", "pool create", "vdev add", diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h b/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h index 61327f9..f890543 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012 by Delphix. All rights reserved. */ #ifndef _ZFS_COMUTIL_H @@ -37,7 +38,8 @@ extern void zpool_get_rewind_policy(nvlist_t *, zpool_rewind_policy_t *); extern int zfs_zpl_version_map(int spa_version); extern int zfs_spa_version_map(int zpl_version); -extern const char *zfs_history_event_names[LOG_END]; +#define ZFS_NUM_LEGACY_HISTORY_EVENTS 41 +extern const char *zfs_history_event_names[ZFS_NUM_LEGACY_HISTORY_EVENTS]; #ifdef __cplusplus } diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c b/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c index 4959335..0463e9a 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c @@ -488,10 +488,10 @@ zcmd_ioctl_compat(int fd, unsigned long cmd, zfs_cmd_t *zc, const int cflag) return (ret); case ZFS_CMD_COMPAT_V28: zc_c = malloc(sizeof(zfs_cmd_v28_t)); - ncmd = _IOWR('Z', ZFS_IOC(cmd), struct zfs_cmd_v28); + ncmd = _IOWR('Z', ZFS_IOCREQ(cmd), struct zfs_cmd_v28); break; case ZFS_CMD_COMPAT_V15: - nc = zfs_ioctl_v28_to_v15[ZFS_IOC(cmd)]; + nc = zfs_ioctl_v28_to_v15[ZFS_IOCREQ(cmd)]; zc_c = malloc(sizeof(zfs_cmd_v15_t)); ncmd = _IOWR('Z', nc, struct zfs_cmd_v15); break; @@ -499,7 +499,7 @@ zcmd_ioctl_compat(int fd, unsigned long cmd, zfs_cmd_t *zc, const int cflag) return (EINVAL); } - if (ZFS_IOC(ncmd) == ZFS_IOC_COMPAT_FAIL) + if (ZFS_IOCREQ(ncmd) == ZFS_IOC_COMPAT_FAIL) return (ENOTSUP); zfs_cmd_compat_put(zc, (caddr_t)zc_c, cflag); diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h b/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h index b20ceca..6e897b8 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h +++ b/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h @@ -56,6 +56,8 @@ extern "C" { #define ZFS_IOC_COMPAT_PASS 254 #define ZFS_IOC_COMPAT_FAIL 255 +#define ZFS_IOCREQ(ioreq) ((ioreq) & 0xff) + typedef struct zinject_record_v15 { uint64_t zi_objset; uint64_t zi_object; diff --git a/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c b/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c index 4d7e79c..ca2e72c 100644 --- a/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c +++ b/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright (c) 2012 by Delphix. All rights reserved. + */ /* * Common routines used by zfs and zpool property management. @@ -129,7 +132,8 @@ zprop_register_hidden(int prop, const char *name, zprop_type_t type, zprop_attr_t attr, int objset_types, const char *colname) { zprop_register_impl(prop, name, type, 0, NULL, attr, - objset_types, NULL, colname, B_FALSE, B_FALSE, NULL); + objset_types, NULL, colname, + type == PROP_TYPE_NUMBER, B_FALSE, NULL); } |