From owner-svn-src-head@FreeBSD.ORG Wed Nov 19 16:59:20 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2046F1065672; Wed, 19 Nov 2008 16:59:20 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0EDBA8FC18; Wed, 19 Nov 2008 16:59:20 +0000 (UTC) (envelope-from dfr@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id mAJGxJ69022808; Wed, 19 Nov 2008 16:59:20 GMT (envelope-from dfr@svn.freebsd.org) Received: (from dfr@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAJGxJO1022805; Wed, 19 Nov 2008 16:59:19 GMT (envelope-from dfr@svn.freebsd.org) Message-Id: <200811191659.mAJGxJO1022805@svn.freebsd.org> From: Doug Rabson Date: Wed, 19 Nov 2008 16:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185097 - in head/sys: boot/zfs cddl/boot/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Nov 2008 16:59:20 -0000 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); }