Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 Nov 2008 16:59:19 +0000 (UTC)
From:      Doug Rabson <dfr@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185097 - in head/sys: boot/zfs cddl/boot/zfs
Message-ID:  <200811191659.mAJGxJO1022805@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dfr
Date: Wed Nov 19 16:59:19 2008
New Revision: 185097
URL: http://svn.freebsd.org/changeset/base/185097

Log:
  Some zfsboot fixes from Norikatsu Shigemura:
  
  1. zfsboot2 (boot2) doesn't %d (printf), so change %d to %u.
  2. chase new zpool versioning as SPA_VERSION.
     Obtained from: sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h
  
  Submitted by:	nork

Modified:
  head/sys/boot/zfs/zfsimpl.c
  head/sys/cddl/boot/zfs/zfsimpl.h
  head/sys/cddl/boot/zfs/zfssubr.c

Modified: head/sys/boot/zfs/zfsimpl.c
==============================================================================
--- head/sys/boot/zfs/zfsimpl.c	Wed Nov 19 16:39:01 2008	(r185096)
+++ head/sys/boot/zfs/zfsimpl.c	Wed Nov 19 16:59:19 2008	(r185097)
@@ -656,8 +656,9 @@ vdev_probe(vdev_read_t *read, void *read
 		return (EIO);
 	}
 
-	if (val != ZFS_VERSION) {
-		printf("ZFS: unsupported ZFS version %d\n", (int) val);
+	if (val > SPA_VERSION) {
+		printf("ZFS: unsupported ZFS version %u (should be %u)\n",
+		    (unsigned) val, (unsigned) SPA_VERSION);
 		return (EIO);
 	}
 

Modified: head/sys/cddl/boot/zfs/zfsimpl.h
==============================================================================
--- head/sys/cddl/boot/zfs/zfsimpl.h	Wed Nov 19 16:39:01 2008	(r185096)
+++ head/sys/cddl/boot/zfs/zfsimpl.h	Wed Nov 19 16:59:19 2008	(r185097)
@@ -448,41 +448,46 @@ typedef enum {
 /*
  * On-disk version number.
  */
-#define	ZFS_VERSION_1			1ULL
-#define	ZFS_VERSION_2			2ULL
-#define	ZFS_VERSION_3			3ULL
-#define	ZFS_VERSION_4			4ULL
-#define	ZFS_VERSION_5			5ULL
-#define	ZFS_VERSION_6			6ULL
+#define	SPA_VERSION_1			1ULL
+#define	SPA_VERSION_2			2ULL
+#define	SPA_VERSION_3			3ULL
+#define	SPA_VERSION_4			4ULL
+#define	SPA_VERSION_5			5ULL
+#define	SPA_VERSION_6			6ULL
+#define	SPA_VERSION_7			7ULL
+#define	SPA_VERSION_8			8ULL
+#define	SPA_VERSION_9			9ULL
+#define	SPA_VERSION_10			10ULL
+#define	SPA_VERSION_11			11ULL
 /*
- * When bumping up ZFS_VERSION, make sure GRUB ZFS understand the on-disk
+ * When bumping up SPA_VERSION, make sure GRUB ZFS understand the on-disk
  * format change. Go to usr/src/grub/grub-0.95/stage2/{zfs-include/, fsys_zfs*},
  * and do the appropriate changes.
  */
-#define	ZFS_VERSION			ZFS_VERSION_6
-#define	ZFS_VERSION_STRING		"6"
+#define	SPA_VERSION			SPA_VERSION_11
+#define	SPA_VERSION_STRING		"11"
 
 /*
- * Symbolic names for the changes that caused a ZFS_VERSION switch.
+ * Symbolic names for the changes that caused a SPA_VERSION switch.
  * Used in the code when checking for presence or absence of a feature.
  * Feel free to define multiple symbolic names for each version if there
  * were multiple changes to on-disk structures during that version.
  *
- * NOTE: When checking the current ZFS_VERSION in your code, be sure
+ * NOTE: When checking the current SPA_VERSION in your code, be sure
  *       to use spa_version() since it reports the version of the
  *       last synced uberblock.  Checking the in-flight version can
  *       be dangerous in some cases.
  */
-#define	ZFS_VERSION_INITIAL		ZFS_VERSION_1
-#define	ZFS_VERSION_DITTO_BLOCKS	ZFS_VERSION_2
-#define	ZFS_VERSION_SPARES		ZFS_VERSION_3
-#define	ZFS_VERSION_RAID6		ZFS_VERSION_3
-#define	ZFS_VERSION_BPLIST_ACCOUNT	ZFS_VERSION_3
-#define	ZFS_VERSION_RAIDZ_DEFLATE	ZFS_VERSION_3
-#define	ZFS_VERSION_DNODE_BYTES		ZFS_VERSION_3
-#define	ZFS_VERSION_ZPOOL_HISTORY	ZFS_VERSION_4
-#define	ZFS_VERSION_GZIP_COMPRESSION	ZFS_VERSION_5
-#define	ZFS_VERSION_BOOTFS		ZFS_VERSION_6
+#define	SPA_VERSION_INITIAL		SPA_VERSION_1
+#define	SPA_VERSION_DITTO_BLOCKS	SPA_VERSION_2
+#define	SPA_VERSION_SPARES		SPA_VERSION_3
+#define	SPA_VERSION_RAID6		SPA_VERSION_3
+#define	SPA_VERSION_BPLIST_ACCOUNT	SPA_VERSION_3
+#define	SPA_VERSION_RAIDZ_DEFLATE	SPA_VERSION_3
+#define	SPA_VERSION_DNODE_BYTES		SPA_VERSION_3
+#define	SPA_VERSION_ZPOOL_HISTORY	SPA_VERSION_4
+#define	SPA_VERSION_GZIP_COMPRESSION	SPA_VERSION_5
+#define	SPA_VERSION_BOOTFS		SPA_VERSION_6
 
 /*
  * The following are configuration names used in the nvlist describing a pool's
@@ -603,7 +608,7 @@ typedef enum pool_state {
 
 struct uberblock {
 	uint64_t	ub_magic;	/* UBERBLOCK_MAGIC		*/
-	uint64_t	ub_version;	/* ZFS_VERSION			*/
+	uint64_t	ub_version;	/* SPA_VERSION			*/
 	uint64_t	ub_txg;		/* txg of last sync		*/
 	uint64_t	ub_guid_sum;	/* sum of all vdev guids	*/
 	uint64_t	ub_timestamp;	/* UTC time of last sync	*/

Modified: head/sys/cddl/boot/zfs/zfssubr.c
==============================================================================
--- head/sys/cddl/boot/zfs/zfssubr.c	Wed Nov 19 16:39:01 2008	(r185096)
+++ head/sys/cddl/boot/zfs/zfssubr.c	Wed Nov 19 16:59:19 2008	(r185097)
@@ -162,7 +162,7 @@ zio_decompress_data(int cpfunc, void *sr
 
 	/* ASSERT((uint_t)cpfunc < ZIO_COMPRESS_FUNCTIONS); */
 	if (!ci->ci_decompress) {
-		printf("ZFS: unsupported compression algorithm %d\n", cpfunc);
+		printf("ZFS: unsupported compression algorithm %u\n", cpfunc);
 		return (EIO);
 	}
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811191659.mAJGxJO1022805>