--- old/usr/src/cmd/ztest/Makefile.com	2013-04-23 17:23:57.107844223 -0600
+++ new/usr/src/cmd/ztest/Makefile.com	2013-04-23 17:23:57.119274373 -0600
@@ -24,8 +24,8 @@
 #
 
 PROG= ztest
-OBJS= $(PROG).o
-SRCS= $(OBJS:%.o=../%.c)
+OBJS= $(PROG).o ztest_util.o
+SRCS= $(OBJS:%.o=../%.c) ztest_util.cpp
 
 include ../../Makefile.cmd
 include ../../Makefile.ctf
@@ -62,6 +62,10 @@
 
 include ../../Makefile.targ
 
+%.o: ../%.cpp
+	$(COMPILE.cc) $<
+	$(POST_PROCESS_O)
+
 %.o: ../%.c
 	$(COMPILE.c) $<
 	$(POST_PROCESS_O)
--- /dev/null	2013-04-23 17:23:57.000000000 -0600
+++ new/usr/src/cmd/ztest/ztest_util.cpp	2013-04-23 17:23:57.382418486 -0600
@@ -0,0 +1,74 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+/*
+ * Copyright (c) 2013 Spectra Logic Corporation.  All rights reserved.
+ */
+
+/*
+ * This file's primary purpose is to build-time enforce C++ compatibility of
+ * the ZFS headers.  However, if desired, it can also be used for utility
+ * functions to be used by ztest.c.
+ */
+
+/* Not sure why these are necessary? */
+#define	B_TRUE _B_TRUE
+#define	B_FALSE _B_FALSE
+
+/* from ztest.c */
+#include <sys/zfs_context.h>
+#include <sys/spa.h>
+#include <sys/dmu.h>
+#include <sys/txg.h>
+#include <sys/dbuf.h>
+#include <sys/zap.h>
+#include <sys/dmu_objset.h>
+#include <sys/poll.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/wait.h>
+#include <sys/mman.h>
+#include <sys/resource.h>
+#include <sys/zio.h>
+#include <sys/zil.h>
+#include <sys/zil_impl.h>
+#include <sys/vdev_impl.h>
+#include <sys/vdev_file.h>
+#include <sys/spa_impl.h>
+#include <sys/metaslab_impl.h>
+#include <sys/dsl_prop.h>
+#include <sys/dsl_dataset.h>
+#include <sys/dsl_destroy.h>
+#include <sys/dsl_scan.h>
+#include <sys/zio_checksum.h>
+#include <sys/refcount.h>
+#include <sys/zfeature.h>
+#include <sys/dsl_userhold.h>
+#include <stdio.h>
+#include <stdio_ext.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <signal.h>
+#include <umem.h>
+#include <dlfcn.h>
+#include <ctype.h>
+#include <math.h>
+#include <sys/fs/zfs.h>
+#include <libnvpair.h>
--- old/usr/src/uts/common/fs/zfs/arc.c	2013-04-23 17:23:57.505266091 -0600
+++ new/usr/src/uts/common/fs/zfs/arc.c	2013-04-23 17:23:57.514855983 -0600
@@ -2786,7 +2786,7 @@
  */
 int
 arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_done_func_t *done,
-    void *private, int priority, int zio_flags, uint32_t *arc_flags,
+    void *cb_private, int priority, int zio_flags, uint32_t *arc_flags,
     const zbookmark_t *zb)
 {
 	arc_buf_hdr_t *hdr;
@@ -2817,7 +2817,7 @@
 				acb = kmem_zalloc(sizeof (arc_callback_t),
 				    KM_SLEEP);
 				acb->acb_done = done;
-				acb->acb_private = private;
+				acb->acb_private = cb_private;
 				if (pio != NULL)
 					acb->acb_zio_dummy = zio_null(pio,
 					    spa, NULL, NULL, NULL, zio_flags);
@@ -2825,7 +2825,7 @@
 				ASSERT(acb->acb_done != NULL);
 				acb->acb_next = hdr->b_acb;
 				hdr->b_acb = acb;
-				add_reference(hdr, hash_lock, private);
+				add_reference(hdr, hash_lock, cb_private);
 				mutex_exit(hash_lock);
 				return (0);
 			}
@@ -2836,7 +2836,7 @@
 		ASSERT(hdr->b_state == arc_mru || hdr->b_state == arc_mfu);
 
 		if (done) {
-			add_reference(hdr, hash_lock, private);
+			add_reference(hdr, hash_lock, cb_private);
 			/*
 			 * If this block is already in use, create a new
 			 * copy of the data so that we will be guaranteed
@@ -2867,7 +2867,7 @@
 		    data, metadata, hits);
 
 		if (done)
-			done(NULL, buf, private);
+			done(NULL, buf, cb_private);
 	} else {
 		uint64_t size = BP_GET_LSIZE(bp);
 		arc_callback_t	*acb;
@@ -2879,7 +2879,7 @@
 			/* this block is not in the cache */
 			arc_buf_hdr_t	*exists;
 			arc_buf_contents_t type = BP_GET_BUFC_TYPE(bp);
-			buf = arc_buf_alloc(spa, size, private, type);
+			buf = arc_buf_alloc(spa, size, cb_private, type);
 			hdr = buf->b_hdr;
 			hdr->b_dva = *BP_IDENTITY(bp);
 			hdr->b_birth = BP_PHYSICAL_BIRTH(bp);
@@ -2889,13 +2889,13 @@
 				/* somebody beat us to the hash insert */
 				mutex_exit(hash_lock);
 				buf_discard_identity(hdr);
-				(void) arc_buf_remove_ref(buf, private);
+				(void) arc_buf_remove_ref(buf, cb_private);
 				goto top; /* restart the IO request */
 			}
 			/* if this is a prefetch, we don't have a reference */
 			if (*arc_flags & ARC_PREFETCH) {
 				(void) remove_reference(hdr, hash_lock,
-				    private);
+				    cb_private);
 				hdr->b_flags |= ARC_PREFETCH;
 			}
 			if (*arc_flags & ARC_L2CACHE)
@@ -2913,7 +2913,7 @@
 			if (*arc_flags & ARC_PREFETCH)
 				hdr->b_flags |= ARC_PREFETCH;
 			else
-				add_reference(hdr, hash_lock, private);
+				add_reference(hdr, hash_lock, cb_private);
 			if (*arc_flags & ARC_L2CACHE)
 				hdr->b_flags |= ARC_L2CACHE;
 			buf = kmem_cache_alloc(buf_cache, KM_PUSHPAGE);
@@ -2933,7 +2933,7 @@
 
 		acb = kmem_zalloc(sizeof (arc_callback_t), KM_SLEEP);
 		acb->acb_done = done;
-		acb->acb_private = private;
+		acb->acb_private = cb_private;
 
 		ASSERT(hdr->b_acb == NULL);
 		hdr->b_acb = acb;
@@ -3046,7 +3046,7 @@
 }
 
 void
-arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private)
+arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *cb_private)
 {
 	ASSERT(buf->b_hdr != NULL);
 	ASSERT(buf->b_hdr->b_state != arc_anon);
@@ -3055,7 +3055,7 @@
 	ASSERT(!HDR_BUF_AVAILABLE(buf->b_hdr));
 
 	buf->b_efunc = func;
-	buf->b_private = private;
+	buf->b_private = cb_private;
 }
 
 /*
@@ -3414,7 +3414,7 @@
 zio_t *
 arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
     blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp,
-    arc_done_func_t *ready, arc_done_func_t *done, void *private,
+    arc_done_func_t *ready, arc_done_func_t *done, void *cb_private,
     int priority, int zio_flags, const zbookmark_t *zb)
 {
 	arc_buf_hdr_t *hdr = buf->b_hdr;
@@ -3431,7 +3431,7 @@
 	callback = kmem_zalloc(sizeof (arc_write_callback_t), KM_SLEEP);
 	callback->awcb_ready = ready;
 	callback->awcb_done = done;
-	callback->awcb_private = private;
+	callback->awcb_private = cb_private;
 	callback->awcb_buf = buf;
 
 	zio = zio_write(pio, spa, txg, bp, buf->b_data, hdr->b_size, zp,
--- old/usr/src/uts/common/fs/zfs/dsl_dataset.c	2013-04-23 17:23:57.976310006 -0600
+++ new/usr/src/uts/common/fs/zfs/dsl_dataset.c	2013-04-23 17:23:57.986560415 -0600
@@ -2755,34 +2755,34 @@
  *                                         oldsnap            new
  */
 int
-dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *new,
+dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *newds,
     uint64_t *usedp, uint64_t *compp, uint64_t *uncompp)
 {
 	int err = 0;
 	uint64_t snapobj;
-	dsl_pool_t *dp = new->ds_dir->dd_pool;
+	dsl_pool_t *dp = newds->ds_dir->dd_pool;
 
 	ASSERT(dsl_pool_config_held(dp));
 
 	*usedp = 0;
-	*usedp += new->ds_phys->ds_referenced_bytes;
+	*usedp += newds->ds_phys->ds_referenced_bytes;
 	*usedp -= oldsnap->ds_phys->ds_referenced_bytes;
 
 	*compp = 0;
-	*compp += new->ds_phys->ds_compressed_bytes;
+	*compp += newds->ds_phys->ds_compressed_bytes;
 	*compp -= oldsnap->ds_phys->ds_compressed_bytes;
 
 	*uncompp = 0;
-	*uncompp += new->ds_phys->ds_uncompressed_bytes;
+	*uncompp += newds->ds_phys->ds_uncompressed_bytes;
 	*uncompp -= oldsnap->ds_phys->ds_uncompressed_bytes;
 
-	snapobj = new->ds_object;
+	snapobj = newds->ds_object;
 	while (snapobj != oldsnap->ds_object) {
 		dsl_dataset_t *snap;
 		uint64_t used, comp, uncomp;
 
-		if (snapobj == new->ds_object) {
-			snap = new;
+		if (snapobj == newds->ds_object) {
+			snap = newds;
 		} else {
 			err = dsl_dataset_hold_obj(dp, snapobj, FTAG, &snap);
 			if (err != 0)
@@ -2813,10 +2813,10 @@
 		/*
 		 * If we get to the beginning of the chain of snapshots
 		 * (ds_prev_snap_obj == 0) before oldsnap, then oldsnap
-		 * was not a snapshot of/before new.
+		 * was not a snapshot of/before newds.
 		 */
 		snapobj = snap->ds_phys->ds_prev_snap_obj;
-		if (snap != new)
+		if (snap != newds)
 			dsl_dataset_rele(snap, FTAG);
 		if (snapobj == 0) {
 			err = SET_ERROR(EINVAL);
--- old/usr/src/uts/common/fs/zfs/sys/arc.h	2013-04-23 17:23:58.358078239 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/arc.h	2013-04-23 17:23:58.367538560 -0600
@@ -38,8 +38,8 @@
 
 typedef struct arc_buf_hdr arc_buf_hdr_t;
 typedef struct arc_buf arc_buf_t;
-typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *private);
-typedef int arc_evict_func_t(void *private);
+typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *cb_private);
+typedef int arc_evict_func_t(void *cb_private);
 
 /* generic arc_done_func_t's which you can use */
 arc_done_func_t arc_bcopy_func;
@@ -102,14 +102,15 @@
 #endif
 
 int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
-    arc_done_func_t *done, void *private, int priority, int flags,
+    arc_done_func_t *done, void *cb_private, int priority, int flags,
     uint32_t *arc_flags, const zbookmark_t *zb);
 zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg,
     blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp,
-    arc_done_func_t *ready, arc_done_func_t *done, void *private,
+    arc_done_func_t *ready, arc_done_func_t *done, void *cb_private,
     int priority, int zio_flags, const zbookmark_t *zb);
 
-void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private);
+void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func,
+    void *cb_private);
 int arc_buf_evict(arc_buf_t *buf);
 
 void arc_flush(spa_t *spa);
--- old/usr/src/uts/common/fs/zfs/sys/ddt.h	2013-04-23 17:23:58.624675645 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/ddt.h	2013-04-23 17:23:58.633508691 -0600
@@ -169,15 +169,15 @@
 #define	DDT_NAMELEN	80
 
 extern void ddt_object_name(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class, char *name);
+    enum ddt_class /*class*/, char *name);
 extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class, uint64_t *walk, ddt_entry_t *dde);
+    enum ddt_class /*class*/, uint64_t *walk, ddt_entry_t *dde);
 extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class);
+    enum ddt_class /*class*/);
 extern int ddt_object_info(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class, dmu_object_info_t *);
+    enum ddt_class /*class*/, dmu_object_info_t *);
 extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class);
+    enum ddt_class /*class*/);
 
 extern void ddt_bp_fill(const ddt_phys_t *ddp, blkptr_t *bp,
     uint64_t txg);
@@ -235,7 +235,7 @@
 extern void ddt_sync(spa_t *spa, uint64_t txg);
 extern int ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde);
 extern int ddt_object_update(ddt_t *ddt, enum ddt_type type,
-    enum ddt_class class, ddt_entry_t *dde, dmu_tx_t *tx);
+    enum ddt_class /*class*/, ddt_entry_t *dde, dmu_tx_t *tx);
 
 extern const ddt_ops_t ddt_zap_ops;
 
--- old/usr/src/uts/common/fs/zfs/sys/dsl_dataset.h	2013-04-23 17:23:58.899491823 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/dsl_dataset.h	2013-04-23 17:23:58.909033312 -0600
@@ -226,7 +226,7 @@
     uint64_t *refdbytesp, uint64_t *availbytesp,
     uint64_t *usedobjsp, uint64_t *availobjsp);
 uint64_t dsl_dataset_fsid_guid(dsl_dataset_t *ds);
-int dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *new,
+int dsl_dataset_space_written(dsl_dataset_t *oldsnap, dsl_dataset_t *newds,
     uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);
 int dsl_dataset_space_wouldfree(dsl_dataset_t *firstsnap, dsl_dataset_t *last,
     uint64_t *usedp, uint64_t *compp, uint64_t *uncompp);
--- old/usr/src/uts/common/fs/zfs/sys/spa.h	2013-04-23 17:23:59.172016550 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/spa.h	2013-04-23 17:23:59.180400978 -0600
@@ -644,7 +644,7 @@
 /* error handling */
 struct zbookmark;
 extern void spa_log_error(spa_t *spa, zio_t *zio);
-extern void zfs_ereport_post(const char *class, spa_t *spa, vdev_t *vd,
+extern void zfs_ereport_post(const char *subclass, spa_t *spa, vdev_t *vd,
     zio_t *zio, uint64_t stateoroffset, uint64_t length);
 extern void zfs_post_remove(spa_t *spa, vdev_t *vd);
 extern void zfs_post_state_change(spa_t *spa, vdev_t *vd);
--- old/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h	2013-04-23 17:23:59.460243637 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/zfs_ioctl.h	2013-04-23 17:23:59.469802669 -0600
@@ -92,23 +92,6 @@
 /* Are all features in the given flag word currently supported? */
 #define	DMU_STREAM_SUPPORTED(x)	(!((x) & ~DMU_BACKUP_FEATURE_MASK))
 
-/*
- * The drr_versioninfo field of the dmu_replay_record has the
- * following layout:
- *
- *	64	56	48	40	32	24	16	8	0
- *	+-------+-------+-------+-------+-------+-------+-------+-------+
- *  	|		reserved	|        feature-flags	    |C|S|
- *	+-------+-------+-------+-------+-------+-------+-------+-------+
- *
- * The low order two bits indicate the header type: SUBSTREAM (0x1)
- * or COMPOUNDSTREAM (0x2).  Using two bits for this is historical:
- * this field used to be a version number, where the two version types
- * were 1 and 2.  Using two bits for this allows earlier versions of
- * the code to be able to recognize send streams that don't use any
- * of the features indicated by feature flags.
- */
-
 #define	DMU_BACKUP_MAGIC 0x2F5bacbacULL
 
 #define	DRR_FLAG_CLONE		(1<<0)
@@ -125,87 +108,117 @@
 /*
  * zfs ioctl command structure
  */
+enum drr_type {
+	DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
+	DRR_WRITE, DRR_FREE, DRR_END, DRR_WRITE_BYREF,
+	DRR_SPILL, DRR_NUMTYPES
+};
+
+struct drr_begin {
+	uint64_t drr_magic;
+	/*
+	 * Formerly named drr_version, this field has the following layout:
+	 *
+	 *  64      56      48      40      32      24      16      8       0
+	 *  +-------+-------+-------+-------+-------+-------+-------+-------+
+	 *  |               reserved        |        feature-flags      |C|S|
+	 *  +-------+-------+-------+-------+-------+-------+-------+-------+
+	 *
+	 * The low order two bits indicate the header type: SUBSTREAM (0x1)
+	 * or COMPOUNDSTREAM (0x2).  Using two bits for this is historical:
+	 * this field used to be a version number, where the two version types
+	 * were 1 and 2.  Using two bits for this allows earlier versions of
+	 * the code to be able to recognize send streams that don't use any
+	 * of the features indicated by feature flags.
+	 */
+	uint64_t drr_versioninfo;
+	uint64_t drr_creation_time;
+	dmu_objset_type_t drr_type;
+	uint32_t drr_flags;
+	uint64_t drr_toguid;
+	uint64_t drr_fromguid;
+	char drr_toname[MAXNAMELEN];
+};
+
+struct drr_end {
+	zio_cksum_t drr_checksum;
+	uint64_t drr_toguid;
+};
+
+struct drr_object {
+	uint64_t drr_object;
+	dmu_object_type_t drr_type;
+	dmu_object_type_t drr_bonustype;
+	uint32_t drr_blksz;
+	uint32_t drr_bonuslen;
+	uint8_t drr_checksumtype;
+	uint8_t drr_compress;
+	uint8_t drr_pad[6];
+	uint64_t drr_toguid;
+	/* bonus content follows */
+};
+
+struct drr_freeobjects {
+	uint64_t drr_firstobj;
+	uint64_t drr_numobjs;
+	uint64_t drr_toguid;
+};
+
+struct drr_write {
+	uint64_t drr_object;
+	dmu_object_type_t drr_type;
+	uint32_t drr_pad;
+	uint64_t drr_offset;
+	uint64_t drr_length;
+	uint64_t drr_toguid;
+	uint8_t drr_checksumtype;
+	uint8_t drr_checksumflags;
+	uint8_t drr_pad2[6];
+	ddt_key_t drr_key;	/* deduplication key */
+	/* content follows */
+};
+
+struct drr_free {
+	uint64_t drr_object;
+	uint64_t drr_offset;
+	uint64_t drr_length;
+	uint64_t drr_toguid;
+};
+
+struct drr_write_byref {
+	uint64_t drr_object;	/* where to put the data */
+	uint64_t drr_offset;
+	uint64_t drr_length;
+	uint64_t drr_toguid;	/* where to find the prior copy of the data */
+	uint64_t drr_refguid;
+	uint64_t drr_refobject;
+	uint64_t drr_refoffset;	/* properties of the data */
+	uint8_t drr_checksumtype;
+	uint8_t drr_checksumflags;
+	uint8_t drr_pad2[6];
+	ddt_key_t drr_key;	/* deduplication key */
+};
+
+struct drr_spill {
+	uint64_t drr_object;
+	uint64_t drr_length;
+	uint64_t drr_toguid;
+	uint64_t drr_pad[4];	/* needed for crypto */
+	/* spill data follows */
+};
+
 typedef struct dmu_replay_record {
-	enum {
-		DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
-		DRR_WRITE, DRR_FREE, DRR_END, DRR_WRITE_BYREF,
-		DRR_SPILL, DRR_NUMTYPES
-	} drr_type;
+	enum drr_type drr_type;
 	uint32_t drr_payloadlen;
 	union {
-		struct drr_begin {
-			uint64_t drr_magic;
-			uint64_t drr_versioninfo; /* was drr_version */
-			uint64_t drr_creation_time;
-			dmu_objset_type_t drr_type;
-			uint32_t drr_flags;
-			uint64_t drr_toguid;
-			uint64_t drr_fromguid;
-			char drr_toname[MAXNAMELEN];
-		} drr_begin;
-		struct drr_end {
-			zio_cksum_t drr_checksum;
-			uint64_t drr_toguid;
-		} drr_end;
-		struct drr_object {
-			uint64_t drr_object;
-			dmu_object_type_t drr_type;
-			dmu_object_type_t drr_bonustype;
-			uint32_t drr_blksz;
-			uint32_t drr_bonuslen;
-			uint8_t drr_checksumtype;
-			uint8_t drr_compress;
-			uint8_t drr_pad[6];
-			uint64_t drr_toguid;
-			/* bonus content follows */
-		} drr_object;
-		struct drr_freeobjects {
-			uint64_t drr_firstobj;
-			uint64_t drr_numobjs;
-			uint64_t drr_toguid;
-		} drr_freeobjects;
-		struct drr_write {
-			uint64_t drr_object;
-			dmu_object_type_t drr_type;
-			uint32_t drr_pad;
-			uint64_t drr_offset;
-			uint64_t drr_length;
-			uint64_t drr_toguid;
-			uint8_t drr_checksumtype;
-			uint8_t drr_checksumflags;
-			uint8_t drr_pad2[6];
-			ddt_key_t drr_key; /* deduplication key */
-			/* content follows */
-		} drr_write;
-		struct drr_free {
-			uint64_t drr_object;
-			uint64_t drr_offset;
-			uint64_t drr_length;
-			uint64_t drr_toguid;
-		} drr_free;
-		struct drr_write_byref {
-			/* where to put the data */
-			uint64_t drr_object;
-			uint64_t drr_offset;
-			uint64_t drr_length;
-			uint64_t drr_toguid;
-			/* where to find the prior copy of the data */
-			uint64_t drr_refguid;
-			uint64_t drr_refobject;
-			uint64_t drr_refoffset;
-			/* properties of the data */
-			uint8_t drr_checksumtype;
-			uint8_t drr_checksumflags;
-			uint8_t drr_pad2[6];
-			ddt_key_t drr_key; /* deduplication key */
-		} drr_write_byref;
-		struct drr_spill {
-			uint64_t drr_object;
-			uint64_t drr_length;
-			uint64_t drr_toguid;
-			uint64_t drr_pad[4]; /* needed for crypto */
-			/* spill data follows */
-		} drr_spill;
+		struct drr_begin drr_begin;
+		struct drr_end drr_end;
+		struct drr_object drr_object;
+		struct drr_freeobjects drr_freeobjects;
+		struct drr_write drr_write;
+		struct drr_free drr_free;
+		struct drr_write_byref drr_write_byref;
+		struct drr_spill drr_spill;
 	} drr_u;
 } dmu_replay_record_t;
 
--- old/usr/src/uts/common/fs/zfs/sys/zio.h	2013-04-23 17:23:59.754897849 -0600
+++ new/usr/src/uts/common/fs/zfs/sys/zio.h	2013-04-23 17:23:59.763895359 -0600
@@ -442,22 +442,22 @@
 };
 
 extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd,
-    zio_done_func_t *done, void *private, enum zio_flag flags);
+    zio_done_func_t *done, void *io_private, enum zio_flag flags);
 
 extern zio_t *zio_root(spa_t *spa,
-    zio_done_func_t *done, void *private, enum zio_flag flags);
+    zio_done_func_t *done, void *io_private, enum zio_flag flags);
 
 extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data,
-    uint64_t size, zio_done_func_t *done, void *private,
+    uint64_t size, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, const zbookmark_t *zb);
 
 extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
     void *data, uint64_t size, const zio_prop_t *zp,
-    zio_done_func_t *ready, zio_done_func_t *done, void *private,
+    zio_done_func_t *ready, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, const zbookmark_t *zb);
 
 extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
-    void *data, uint64_t size, zio_done_func_t *done, void *private,
+    void *data, uint64_t size, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, zbookmark_t *zb);
 
 extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies,
@@ -467,19 +467,20 @@
 
 extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
     const blkptr_t *bp,
-    zio_done_func_t *done, void *private, enum zio_flag flags);
+    zio_done_func_t *done, void *io_private, enum zio_flag flags);
 
 extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
-    zio_done_func_t *done, void *private, int priority, enum zio_flag flags);
+    zio_done_func_t *done, void *io_private, int priority,
+    enum zio_flag flags);
 
 extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
     uint64_t size, void *data, int checksum,
-    zio_done_func_t *done, void *private, int priority, enum zio_flag flags,
+    zio_done_func_t *done, void *io_private, int priority, enum zio_flag flags,
     boolean_t labels);
 
 extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
     uint64_t size, void *data, int checksum,
-    zio_done_func_t *done, void *private, int priority, enum zio_flag flags,
+    zio_done_func_t *done, void *io_private, int priority, enum zio_flag flags,
     boolean_t labels);
 
 extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg,
@@ -510,11 +511,11 @@
 
 extern zio_t *zio_vdev_child_io(zio_t *zio, blkptr_t *bp, vdev_t *vd,
     uint64_t offset, void *data, uint64_t size, int type, int priority,
-    enum zio_flag flags, zio_done_func_t *done, void *private);
+    enum zio_flag flags, zio_done_func_t *done, void *io_private);
 
 extern zio_t *zio_vdev_delegated_io(vdev_t *vd, uint64_t offset,
     void *data, uint64_t size, int type, int priority,
-    enum zio_flag flags, zio_done_func_t *done, void *private);
+    enum zio_flag flags, zio_done_func_t *done, void *io_private);
 
 extern void zio_vdev_io_bypass(zio_t *zio);
 extern void zio_vdev_io_reissue(zio_t *zio);
--- old/usr/src/uts/common/fs/zfs/zio.c	2013-04-23 17:24:00.042261470 -0600
+++ new/usr/src/uts/common/fs/zfs/zio.c	2013-04-23 17:24:00.051518821 -0600
@@ -509,7 +509,7 @@
  */
 static zio_t *
 zio_create(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
-    void *data, uint64_t size, zio_done_func_t *done, void *private,
+    void *data, uint64_t size, zio_done_func_t *done, void *io_private,
     zio_type_t type, int priority, enum zio_flag flags,
     vdev_t *vd, uint64_t offset, const zbookmark_t *zb,
     enum zio_stage stage, enum zio_stage pipeline)
@@ -560,7 +560,7 @@
 	zio->io_spa = spa;
 	zio->io_txg = txg;
 	zio->io_done = done;
-	zio->io_private = private;
+	zio->io_private = io_private;
 	zio->io_type = type;
 	zio->io_priority = priority;
 	zio->io_vd = vd;
@@ -600,11 +600,11 @@
 
 zio_t *
 zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, zio_done_func_t *done,
-    void *private, enum zio_flag flags)
+    void *io_private, enum zio_flag flags)
 {
 	zio_t *zio;
 
-	zio = zio_create(pio, spa, 0, NULL, NULL, 0, done, private,
+	zio = zio_create(pio, spa, 0, NULL, NULL, 0, done, io_private,
 	    ZIO_TYPE_NULL, ZIO_PRIORITY_NOW, flags, vd, 0, NULL,
 	    ZIO_STAGE_OPEN, ZIO_INTERLOCK_PIPELINE);
 
@@ -612,20 +612,21 @@
 }
 
 zio_t *
-zio_root(spa_t *spa, zio_done_func_t *done, void *private, enum zio_flag flags)
+zio_root(spa_t *spa, zio_done_func_t *done, void *io_private,
+    enum zio_flag flags)
 {
-	return (zio_null(NULL, spa, NULL, done, private, flags));
+	return (zio_null(NULL, spa, NULL, done, io_private, flags));
 }
 
 zio_t *
 zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp,
-    void *data, uint64_t size, zio_done_func_t *done, void *private,
+    void *data, uint64_t size, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, const zbookmark_t *zb)
 {
 	zio_t *zio;
 
 	zio = zio_create(pio, spa, BP_PHYSICAL_BIRTH(bp), bp,
-	    data, size, done, private,
+	    data, size, done, io_private,
 	    ZIO_TYPE_READ, priority, flags, NULL, 0, zb,
 	    ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ?
 	    ZIO_DDT_CHILD_READ_PIPELINE : ZIO_READ_PIPELINE);
@@ -636,7 +637,7 @@
 zio_t *
 zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp,
     void *data, uint64_t size, const zio_prop_t *zp,
-    zio_done_func_t *ready, zio_done_func_t *done, void *private,
+    zio_done_func_t *ready, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, const zbookmark_t *zb)
 {
 	zio_t *zio;
@@ -650,7 +651,7 @@
 	    zp->zp_copies > 0 &&
 	    zp->zp_copies <= spa_max_replication(spa));
 
-	zio = zio_create(pio, spa, txg, bp, data, size, done, private,
+	zio = zio_create(pio, spa, txg, bp, data, size, done, io_private,
 	    ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb,
 	    ZIO_STAGE_OPEN, (flags & ZIO_FLAG_DDT_CHILD) ?
 	    ZIO_DDT_CHILD_WRITE_PIPELINE : ZIO_WRITE_PIPELINE);
@@ -663,12 +664,12 @@
 
 zio_t *
 zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data,
-    uint64_t size, zio_done_func_t *done, void *private, int priority,
+    uint64_t size, zio_done_func_t *done, void *io_private, int priority,
     enum zio_flag flags, zbookmark_t *zb)
 {
 	zio_t *zio;
 
-	zio = zio_create(pio, spa, txg, bp, data, size, done, private,
+	zio = zio_create(pio, spa, txg, bp, data, size, done, io_private,
 	    ZIO_TYPE_WRITE, priority, flags, NULL, 0, zb,
 	    ZIO_STAGE_OPEN, ZIO_REWRITE_PIPELINE);
 
@@ -725,7 +726,7 @@
 
 zio_t *
 zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
-    zio_done_func_t *done, void *private, enum zio_flag flags)
+    zio_done_func_t *done, void *io_private, enum zio_flag flags)
 {
 	zio_t *zio;
 
@@ -746,7 +747,7 @@
 	ASSERT(!BP_GET_DEDUP(bp) || !spa_writeable(spa));	/* zdb(1M) */
 
 	zio = zio_create(pio, spa, txg, bp, NULL, BP_GET_PSIZE(bp),
-	    done, private, ZIO_TYPE_CLAIM, ZIO_PRIORITY_NOW, flags,
+	    done, io_private, ZIO_TYPE_CLAIM, ZIO_PRIORITY_NOW, flags,
 	    NULL, 0, NULL, ZIO_STAGE_OPEN, ZIO_CLAIM_PIPELINE);
 
 	return (zio);
@@ -754,13 +755,13 @@
 
 zio_t *
 zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
-    zio_done_func_t *done, void *private, int priority, enum zio_flag flags)
+    zio_done_func_t *done, void *io_private, int priority, enum zio_flag flags)
 {
 	zio_t *zio;
 	int c;
 
 	if (vd->vdev_children == 0) {
-		zio = zio_create(pio, spa, 0, NULL, NULL, 0, done, private,
+		zio = zio_create(pio, spa, 0, NULL, NULL, 0, done, io_private,
 		    ZIO_TYPE_IOCTL, priority, flags, vd, 0, NULL,
 		    ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE);
 
@@ -770,7 +771,7 @@
 
 		for (c = 0; c < vd->vdev_children; c++)
 			zio_nowait(zio_ioctl(zio, spa, vd->vdev_child[c], cmd,
-			    done, private, priority, flags));
+			    done, io_private, priority, flags));
 	}
 
 	return (zio);
@@ -778,7 +779,7 @@
 
 zio_t *
 zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
-    void *data, int checksum, zio_done_func_t *done, void *private,
+    void *data, int checksum, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, boolean_t labels)
 {
 	zio_t *zio;
@@ -788,8 +789,8 @@
 	    offset >= vd->vdev_psize - VDEV_LABEL_END_SIZE);
 	ASSERT3U(offset + size, <=, vd->vdev_psize);
 
-	zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private,
-	    ZIO_TYPE_READ, priority, flags, vd, offset, NULL,
+	zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done,
+	    io_private, ZIO_TYPE_READ, priority, flags, vd, offset, NULL,
 	    ZIO_STAGE_OPEN, ZIO_READ_PHYS_PIPELINE);
 
 	zio->io_prop.zp_checksum = checksum;
@@ -799,7 +800,7 @@
 
 zio_t *
 zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size,
-    void *data, int checksum, zio_done_func_t *done, void *private,
+    void *data, int checksum, zio_done_func_t *done, void *io_private,
     int priority, enum zio_flag flags, boolean_t labels)
 {
 	zio_t *zio;
@@ -809,8 +810,8 @@
 	    offset >= vd->vdev_psize - VDEV_LABEL_END_SIZE);
 	ASSERT3U(offset + size, <=, vd->vdev_psize);
 
-	zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done, private,
-	    ZIO_TYPE_WRITE, priority, flags, vd, offset, NULL,
+	zio = zio_create(pio, vd->vdev_spa, 0, NULL, data, size, done,
+	    io_private, ZIO_TYPE_WRITE, priority, flags, vd, offset, NULL,
 	    ZIO_STAGE_OPEN, ZIO_WRITE_PHYS_PIPELINE);
 
 	zio->io_prop.zp_checksum = checksum;
@@ -836,7 +837,7 @@
 zio_t *
 zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd, uint64_t offset,
 	void *data, uint64_t size, int type, int priority, enum zio_flag flags,
-	zio_done_func_t *done, void *private)
+	zio_done_func_t *done, void *io_private)
 {
 	enum zio_stage pipeline = ZIO_VDEV_CHILD_PIPELINE;
 	zio_t *zio;
@@ -868,8 +869,8 @@
 		flags &= ~ZIO_FLAG_SPECULATIVE;
 
 	zio = zio_create(pio, pio->io_spa, pio->io_txg, bp, data, size,
-	    done, private, type, priority, flags, vd, offset, &pio->io_bookmark,
-	    ZIO_STAGE_VDEV_IO_START >> 1, pipeline);
+	    done, io_private, type, priority, flags, vd, offset,
+	    &pio->io_bookmark, ZIO_STAGE_VDEV_IO_START >> 1, pipeline);
 
 	return (zio);
 }
@@ -877,14 +878,14 @@
 zio_t *
 zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size,
 	int type, int priority, enum zio_flag flags,
-	zio_done_func_t *done, void *private)
+	zio_done_func_t *done, void *io_private)
 {
 	zio_t *zio;
 
 	ASSERT(vd->vdev_ops->vdev_op_leaf);
 
 	zio = zio_create(NULL, vd->vdev_spa, 0, NULL,
-	    data, size, done, private, type, priority,
+	    data, size, done, io_private, type, priority,
 	    flags | ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_RETRY,
 	    vd, offset, NULL,
 	    ZIO_STAGE_VDEV_IO_START >> 1, ZIO_VDEV_CHILD_PIPELINE);
