From owner-svn-src-stable-8@FreeBSD.ORG Mon Jun 6 09:36:46 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B36C81065676; Mon, 6 Jun 2011 09:36:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D46F8FC13; Mon, 6 Jun 2011 09:36:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p569akcP021531; Mon, 6 Jun 2011 09:36:46 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p569akMo021518; Mon, 6 Jun 2011 09:36:46 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201106060936.p569akMo021518@svn.freebsd.org> From: Martin Matuska Date: Mon, 6 Jun 2011 09:36:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r222741 - in stable/8: . cddl/compat/opensolaris/include cddl/compat/opensolaris/misc cddl/contrib/opensolaris/cmd/stat cddl/contrib/opensolaris/cmd/zdb cddl/contrib/opensolaris/cmd/zfs... X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 09:36:46 -0000 Author: mm Date: Mon Jun 6 09:36:46 2011 New Revision: 222741 URL: http://svn.freebsd.org/changeset/base/222741 Log: MFC ZFS version 28 and related revisions: 208682, 211900, 212543, 213791, 216378, 218007, 218725, 219089, 219090, 219092, 219316, 219317, 219320, 219404, 219636, 219703, 219959, 219973, 220447, 220575, 221112, 221177, 221263, 221409, 222050, 222267, 222268 MFC r208682 (pjd): Fix panic when reading label from provider with non power of 2 sector size. MFC r211900 (pjd): Use ZFS_CTLDIR_NAME instead of hardcoding ".zfs". MFC r212543 (imp): Simplify atomic selection MFC r213791 (rpaulo): Pass a format string to panic() and to taskqueue_start_threads(). Found with: clang MFC r216378 (pjd): Remove redundant semicolon and empty like. MFC r218007 (jchandra): CDDL fixes for MIPS n32. Provide 64 bit atomic ops, and use 32 bit pointer. MFC r218725 (dim): When building libzpool on ia64 or sparc64, don't add the .note.GNU-stack section. MFC r219089 (pjd): Finally... Import the latest open-source ZFS version - (SPA) 28. Few new things available from now on: - Data deduplication. - Triple parity RAIDZ (RAIDZ3). - zfs diff. - zpool split. - Snapshot holds. - zpool import -F. Allows to rewind corrupted pool to earlier transaction group. - Possibility to import pool in read-only mode. MFC r219090 (pjd): Commit two more files missed in r219089. MFC r219092 (pjd): Use proper lock in assertion. MFC r219316 (pjd): Simplify zvol_remove_minors() a bit. MFC r219317 (pjd): Make renaming of a ZVOL, ZVOL's parent directory and ZVOL snapshot work. MFC r219320 (pjd): Fix libzpool build. MFC r219404 (pjd): Correct readdir over ZFS handling. MFC r219636 (pjd): Fix potential panic in dbuf_sync_list() relate to spill blocks handling. MFC r219703 (ae): The size of zfsboot2 grown up to 64 Kbytes in r219089. Increase NSECT up to 128 sectors too. MFC r219959 (pjd): Properly print characters larger than 127. MFC r219973 (pjd): Checking file access on size change is bogus. The checks are done earlier by VFS where we know if this is truncate(2) or ftruncate(2). If this is the latter we should depend on the mode the file was opened and not on the current permission. MFC r220447 (mm): Partially fix ZFS compat code for sparc64. Some endianess bugs still need to be resolved. MFC r220575 (pjd): Fix 'zfs list ' handling. If the path was found, the 'ret' variable was uninitialized. MFC r221112 (marcel): Fix copy-paste bug. MFC r221177 (jhb): Due to space constraints, the UFS boot2 and boot1 use an evil hack where boot2 calls back into boot1 to perform disk reads. The ZFS MBR boot blocks do not have the same space constraints, so remove this hack for ZFS. While here, remove commented out code to support C/H/S addressing from zfsldr. The ZFS and GPT bootstraps always just use EDD LBA addressing. MFC r221263 (mm): Fix deduplicated zfs receive (dmu_recv_stream builds incomplete guid_to_ds_map) Illumos-gate changeset: 13329:c48b8bf84ab7 MFC r221409 (marius): Convert the last use of xcopyout() to ddi_copyout() and remove the now unused xcopyin() as well as xcopyout(). MFC r222050 (mm): Restore old (v15) behaviour for a recursive snapshot destroy. (zfs destroy -r pool/dataset@snapshot) To destroy all descendent snapshots with the same name the top level snapshot was not required to exist. So if the top level snapshot does not exist, check permissions of the parent dataset instead. Filed as Illumos Bug #1043 MFC r222267 (pjd): Don't access task structure once we call task function. The task structure might be no longer available. This also allows to eliminates the need for two tasks in the zio structure. MFC r222268 (pjd): Don't pass pointer to name buffer which is on the stack to another thread, because the stack might be paged out once the other thread tries to use the data. Instead, just allocate memory. Discussed with: pjd Added: stable/8/cddl/compat/opensolaris/include/sha2.h - copied unchanged from r219089, head/cddl/compat/opensolaris/include/sha2.h stable/8/cddl/compat/opensolaris/include/thread_pool.h - copied unchanged from r219089, head/cddl/compat/opensolaris/include/thread_pool.h stable/8/cddl/contrib/opensolaris/cmd/stat/ - copied from r219089, head/cddl/contrib/opensolaris/cmd/stat/ stable/8/cddl/contrib/opensolaris/cmd/zlook/ - copied from r219089, head/cddl/contrib/opensolaris/cmd/zlook/ stable/8/cddl/contrib/opensolaris/cmd/zstreamdump/ - copied from r219089, head/cddl/contrib/opensolaris/cmd/zstreamdump/ stable/8/cddl/contrib/opensolaris/lib/libuutil/common/uu_string.c - copied unchanged from r219089, head/cddl/contrib/opensolaris/lib/libuutil/common/uu_string.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c - copied, changed from r219089, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_diff.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c - copied unchanged from r219089, head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_fru.c stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/holds.py - copied unchanged from r219089, head/cddl/contrib/opensolaris/lib/pyzfs/common/holds.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/table.py - copied unchanged from r219089, head/cddl/contrib/opensolaris/lib/pyzfs/common/table.py stable/8/cddl/usr.bin/zlook/ - copied from r219089, head/cddl/usr.bin/zlook/ stable/8/cddl/usr.bin/zstreamdump/ - copied from r219089, head/cddl/usr.bin/zstreamdump/ stable/8/sys/cddl/boot/zfs/zle.c - copied unchanged from r219089, head/sys/cddl/boot/zfs/zle.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c - copied, changed from r219089, head/sys/cddl/compat/opensolaris/kern/opensolaris_sunddi.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c - copied, changed from r219089, head/sys/cddl/compat/opensolaris/kern/opensolaris_sysevent.c stable/8/sys/cddl/compat/opensolaris/sys/systeminfo.h - copied unchanged from r219089, head/sys/cddl/compat/opensolaris/sys/systeminfo.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/common/zfs/zfs_fletcher.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c - copied, changed from r219089, head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/common/zfs/zfs_ioctl_compat.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bpobj.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_diff.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deadlist.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scan.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bpobj.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deadlist.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deadlist.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_scan.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/sa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_onexit.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_onexit.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_sa.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_sa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_stat.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_stat.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zrlock.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_debug.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_onexit.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zle.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zrlock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/os/fm.c - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/os/fm.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zut.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zut.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/dev.h - copied unchanged from r219089, head/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/dev.h Deleted: stable/8/sys/cddl/compat/opensolaris/sys/sysmacros.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_scrub.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/fletcher.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/byteorder.h Modified: stable/8/Makefile.inc1 (contents, props changed) stable/8/UPDATING stable/8/cddl/compat/opensolaris/include/fcntl.h stable/8/cddl/compat/opensolaris/include/mnttab.h stable/8/cddl/compat/opensolaris/include/priv.h stable/8/cddl/compat/opensolaris/include/solaris.h stable/8/cddl/compat/opensolaris/misc/fsshare.c stable/8/cddl/compat/opensolaris/misc/zmount.c stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb_il.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs.8 stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.h stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c stable/8/cddl/contrib/opensolaris/cmd/zfs/zfs_util.h stable/8/cddl/contrib/opensolaris/cmd/zinject/translate.c stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.c stable/8/cddl/contrib/opensolaris/cmd/zinject/zinject.h stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool.8 stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_util.c stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_util.h stable/8/cddl/contrib/opensolaris/cmd/zpool/zpool_vdev.c stable/8/cddl/contrib/opensolaris/cmd/ztest/ztest.c stable/8/cddl/contrib/opensolaris/head/synch.h stable/8/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.c stable/8/cddl/contrib/opensolaris/lib/libnvpair/libnvpair.h stable/8/cddl/contrib/opensolaris/lib/libuutil/common/libuutil.h stable/8/cddl/contrib/opensolaris/lib/libuutil/common/uu_alloc.c stable/8/cddl/contrib/opensolaris/lib/libuutil/common/uu_misc.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_changelist.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_config.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_impl.h stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_import.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_mount.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_pool.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_status.c stable/8/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/kernel.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/sys/zfs_context.h stable/8/cddl/contrib/opensolaris/lib/libzpool/common/taskq.c stable/8/cddl/contrib/opensolaris/lib/libzpool/common/util.c stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/__init__.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/allow.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/dataset.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/groupspace.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/ioctl.c stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/unallow.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/userspace.py stable/8/cddl/contrib/opensolaris/lib/pyzfs/common/util.py stable/8/cddl/lib/libzfs/Makefile stable/8/cddl/lib/libzpool/Makefile stable/8/cddl/sbin/zfs/Makefile stable/8/cddl/sbin/zpool/Makefile stable/8/cddl/usr.bin/Makefile stable/8/cddl/usr.bin/ztest/Makefile stable/8/cddl/usr.sbin/zdb/Makefile stable/8/etc/rc.d/zvol stable/8/rescue/rescue/Makefile stable/8/sys/boot/i386/boot2/Makefile stable/8/sys/boot/i386/common/drv.c stable/8/sys/boot/i386/gptzfsboot/Makefile stable/8/sys/boot/i386/zfsboot/Makefile stable/8/sys/boot/i386/zfsboot/zfsldr.S stable/8/sys/boot/zfs/zfs.c stable/8/sys/boot/zfs/zfsimpl.c stable/8/sys/cddl/boot/zfs/fletcher.c stable/8/sys/cddl/boot/zfs/zfsimpl.h stable/8/sys/cddl/boot/zfs/zfssubr.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_cmn_err.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_kmem.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_misc.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_string.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_zone.c stable/8/sys/cddl/compat/opensolaris/sys/atomic.h stable/8/sys/cddl/compat/opensolaris/sys/byteorder.h stable/8/sys/cddl/compat/opensolaris/sys/dirent.h stable/8/sys/cddl/compat/opensolaris/sys/file.h stable/8/sys/cddl/compat/opensolaris/sys/kmem.h stable/8/sys/cddl/compat/opensolaris/sys/misc.h stable/8/sys/cddl/compat/opensolaris/sys/mount.h stable/8/sys/cddl/compat/opensolaris/sys/mutex.h stable/8/sys/cddl/compat/opensolaris/sys/policy.h stable/8/sys/cddl/compat/opensolaris/sys/proc.h stable/8/sys/cddl/compat/opensolaris/sys/rwlock.h stable/8/sys/cddl/compat/opensolaris/sys/sid.h stable/8/sys/cddl/compat/opensolaris/sys/stat.h stable/8/sys/cddl/compat/opensolaris/sys/string.h stable/8/sys/cddl/compat/opensolaris/sys/sunddi.h stable/8/sys/cddl/compat/opensolaris/sys/systm.h stable/8/sys/cddl/compat/opensolaris/sys/taskq.h stable/8/sys/cddl/compat/opensolaris/sys/time.h stable/8/sys/cddl/compat/opensolaris/sys/types.h stable/8/sys/cddl/compat/opensolaris/sys/uio.h stable/8/sys/cddl/compat/opensolaris/sys/vfs.h stable/8/sys/cddl/compat/opensolaris/sys/vnode.h stable/8/sys/cddl/compat/opensolaris/sys/zone.h stable/8/sys/cddl/contrib/opensolaris/common/acl/acl_common.c stable/8/sys/cddl/contrib/opensolaris/common/acl/acl_common.h stable/8/sys/cddl/contrib/opensolaris/common/atomic/amd64/opensolaris_atomic.S stable/8/sys/cddl/contrib/opensolaris/common/atomic/i386/opensolaris_atomic.S stable/8/sys/cddl/contrib/opensolaris/common/atomic/ia64/opensolaris_atomic.S stable/8/sys/cddl/contrib/opensolaris/common/atomic/sparc64/opensolaris_atomic.S stable/8/sys/cddl/contrib/opensolaris/common/avl/avl.c stable/8/sys/cddl/contrib/opensolaris/common/nvpair/nvpair.c stable/8/sys/cddl/contrib/opensolaris/common/unicode/u8_textprep.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_comutil.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_deleg.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_namecheck.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zfs_prop.h stable/8/sys/cddl/contrib/opensolaris/common/zfs/zpool_prop.c stable/8/sys/cddl/contrib/opensolaris/common/zfs/zprop_common.c stable/8/sys/cddl/contrib/opensolaris/uts/common/Makefile.files stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/gfs.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/vnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/bplist.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dbuf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_object.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_objset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_send.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_traverse.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_tx.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dmu_zfetch.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dnode_sync.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dataset.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_deleg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_pool.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_prop.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_synctask.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lzjb.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/refcount.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sha256.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_config.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_errlog.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_history.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/spa_misc.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/space_map.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/bplist.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dbuf.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_objset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_traverse.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dmu_tx.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dnode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dataset.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_deleg.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_dir.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_prop.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_synctask.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/metaslab_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/refcount.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_boot.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/txg_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/uberblock_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/vdev_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zap_leaf.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_acl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_context.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_fuid.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zil_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_checksum.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_compress.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zvol.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/txg.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/uberblock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_cache.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_disk.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_file.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_label.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_missing.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_raidz.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_root.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_leaf.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zap_micro.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_byteswap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fm.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_fuid.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_log.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_replay.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_rlock.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zil.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_checksum.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_compress.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio_inject.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c stable/8/sys/cddl/contrib/opensolaris/uts/common/os/callb.c stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/acl_impl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/avl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/callb.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/cpupart.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/cpuvar.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/cred.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/debug.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/fs/zfs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/protocol.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fm/util.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/fs/zfs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/gfs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/idmap.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/isa_defs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/nvpair.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/processor.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/sysevent/eventdefs.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/sysmacros.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/taskq.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/u8_textprep.h stable/8/sys/cddl/contrib/opensolaris/uts/common/sys/vnode.h stable/8/sys/modules/opensolaris/Makefile stable/8/sys/modules/zfs/Makefile stable/8/sys/sys/param.h stable/8/usr.bin/fstat/zfs.c Directory Properties: stable/8/cddl/compat/opensolaris/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/cddl/lib/ (props changed) stable/8/cddl/lib/libnvpair/ (props changed) stable/8/cddl/lib/libzpool/ (props changed) stable/8/cddl/sbin/ (props changed) stable/8/cddl/usr.bin/ (props changed) stable/8/cddl/usr.sbin/ (props changed) stable/8/etc/ (props changed) stable/8/rescue/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/usr.bin/fstat/ (props changed) Modified: stable/8/Makefile.inc1 ============================================================================== --- stable/8/Makefile.inc1 Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/Makefile.inc1 Mon Jun 6 09:36:46 2011 (r222741) @@ -1105,6 +1105,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1 lib/ncurses/ncurses lib/ncurses/ncursesw \ lib/libopie lib/libpam ${_lib_libthr} \ lib/libradius lib/libsbuf lib/libtacplus \ + ${_cddl_lib_libumem} \ lib/libutil ${_lib_libypclnt} lib/libz lib/msun \ ${_secure_lib_libcrypto} ${_secure_lib_libssh} \ ${_secure_lib_libssl} @@ -1118,6 +1119,7 @@ _generic_libs= ${_cddl_lib} gnu/lib ${_k lib/libopie__L lib/libtacplus__L: lib/libmd__L .if ${MK_CDDL} != "no" +_cddl_lib_libumem= cddl/lib/libumem _cddl_lib= cddl/lib .endif Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/UPDATING Mon Jun 6 09:36:46 2011 (r222741) @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20110606: + A new version of ZFS (version 28) has been merged. + This version does not depend on a python library and the + sysutils/py-zfs port is not used anymore. + For upgrading your boot pool, please read "ZFS notes" + in the COMMON ITEMS: section later in this file. + 20110428: IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868 compliant, and will now use half of hash for authentication. Modified: stable/8/cddl/compat/opensolaris/include/fcntl.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/fcntl.h Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/include/fcntl.h Mon Jun 6 09:36:46 2011 (r222741) @@ -32,6 +32,7 @@ #include_next -#define open64 open +#define open64(...) open(__VA_ARGS__) +#define openat64(...) openat(__VA_ARGS__) #endif Modified: stable/8/cddl/compat/opensolaris/include/mnttab.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/mnttab.h Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/include/mnttab.h Mon Jun 6 09:36:46 2011 (r222741) @@ -12,6 +12,10 @@ #define MNTTAB _PATH_DEVZERO #define MNT_LINE_MAX 1024 +#define MS_OVERLAY 0x0 +#define MS_NOMNTTAB 0x0 +#define MS_RDONLY 0x1 + #define umount2(p, f) unmount(p, f) struct mnttab { Modified: stable/8/cddl/compat/opensolaris/include/priv.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/priv.h Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/include/priv.h Mon Jun 6 09:36:46 2011 (r222741) @@ -10,7 +10,7 @@ #define PRIV_SYS_CONFIG 0 static __inline int -priv_ineffect(priv) +priv_ineffect(int priv) { assert(priv == PRIV_SYS_CONFIG); Copied: stable/8/cddl/compat/opensolaris/include/sha2.h (from r219089, head/cddl/compat/opensolaris/include/sha2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/compat/opensolaris/include/sha2.h Mon Jun 6 09:36:46 2011 (r222741, copy of r219089, head/cddl/compat/opensolaris/include/sha2.h) @@ -0,0 +1,38 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SHA2_H_ +#define _OPENSOLARIS_SHA2_H_ + +#include_next + +#define SHA256Init(c) SHA256_Init(c) +#define SHA256Update(c, d, s) SHA256_Update((c), (d), (s)) +#define SHA256Final(b, c) SHA256_Final((unsigned char *)(b), (c)) + +#endif /* !_OPENSOLARIS_SHA2_H_ */ Modified: stable/8/cddl/compat/opensolaris/include/solaris.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/solaris.h Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/include/solaris.h Mon Jun 6 09:36:46 2011 (r222741) @@ -5,6 +5,10 @@ #include -#define dirent64 dirent +#include + +#define NOTE(s) + +int mkdirp(const char *, mode_t); #endif /* !_SOLARIS_H_ */ Copied: stable/8/cddl/compat/opensolaris/include/thread_pool.h (from r219089, head/cddl/compat/opensolaris/include/thread_pool.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/cddl/compat/opensolaris/include/thread_pool.h Mon Jun 6 09:36:46 2011 (r222741, copy of r219089, head/cddl/compat/opensolaris/include/thread_pool.h) @@ -0,0 +1,39 @@ +/*- + * Copyright (c) 2010 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_THREAD_POOL_H_ +#define _OPENSOLARIS_THREAD_POOL_H_ + +typedef int tpool_t; + +#define tpool_create(a, b, c, d) (0) +#define tpool_dispatch(pool, func, arg) func(arg) +#define tpool_wait(pool) do { } while (0) +#define tpool_destroy(pool) do { } while (0) + +#endif /* !_OPENSOLARIS_THREAD_POOL_H_ */ Modified: stable/8/cddl/compat/opensolaris/misc/fsshare.c ============================================================================== --- stable/8/cddl/compat/opensolaris/misc/fsshare.c Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/misc/fsshare.c Mon Jun 6 09:36:46 2011 (r222741) @@ -28,15 +28,17 @@ __FBSDID("$FreeBSD$"); #include -#include -#include -#include -#include + +#include #include +#include +#include #include -#include #include /* _PATH_MOUNTDPID */ -#include +#include +#include +#include +#include #define FILE_HEADER "# !!! DO NOT EDIT THIS FILE MANUALLY !!!\n\n" #define OPTSSIZE 1024 Modified: stable/8/cddl/compat/opensolaris/misc/zmount.c ============================================================================== --- stable/8/cddl/compat/opensolaris/misc/zmount.c Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/compat/opensolaris/misc/zmount.c Mon Jun 6 09:36:46 2011 (r222741) @@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, @@ -78,7 +79,7 @@ zmount(const char *spec, const char *dir assert(spec != NULL); assert(dir != NULL); - assert(mflag == 0); + assert(mflag == 0 || mflag == MS_RDONLY); assert(fstype != NULL); assert(strcmp(fstype, MNTTYPE_ZFS) == 0); assert(dataptr == NULL); @@ -91,6 +92,8 @@ zmount(const char *spec, const char *dir iov = NULL; iovlen = 0; + if (mflag & MS_RDONLY) + build_iovec(&iov, &iovlen, "ro", NULL, 0); build_iovec(&iov, &iovlen, "fstype", fstype, (size_t)-1); build_iovec(&iov, &iovlen, "fspath", __DECONST(char *, dir), (size_t)-1); Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 6 07:26:07 2011 (r222740) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Mon Jun 6 09:36:46 2011 (r222741) @@ -19,8 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. */ #include @@ -34,6 +33,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -51,10 +53,25 @@ #include #include #include +#include #undef ZFS_MAXNAMELEN #undef verify #include +#define ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ? \ + zio_compress_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ? \ + zio_checksum_table[(idx)].ci_name : "UNKNOWN") +#define ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ? \ + dmu_ot[(idx)].ot_name : "UNKNOWN") +#define ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) : DMU_OT_NUMTYPES) + +#ifndef lint +extern int zfs_recover; +#else +int zfs_recover; +#endif + const char cmdname[] = "zdb"; uint8_t dump_opt[256]; @@ -64,8 +81,6 @@ extern void dump_intent_log(zilog_t *); uint64_t *zopt_object = NULL; int zopt_objects = 0; libzfs_handle_t *g_zfs; -boolean_t zdb_sig_user_data = B_TRUE; -int zdb_sig_cksumalg = ZIO_CHECKSUM_SHA256; /* * These libumem hooks provide a reasonable set of defaults for the allocator's @@ -87,39 +102,56 @@ static void usage(void) { (void) fprintf(stderr, - "Usage: %s [-udibcsvL] [-U cachefile_path] [-t txg]\n" - "\t [-S user:cksumalg] " - "dataset [object...]\n" - " %s -C [pool]\n" - " %s -l dev\n" - " %s -R pool:vdev:offset:size:flags\n" - " %s [-p path_to_vdev_dir]\n" - " %s -e pool | GUID | devid ...\n", - cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); - - (void) fprintf(stderr, " -u uberblock\n"); - (void) fprintf(stderr, " -d datasets\n"); - (void) fprintf(stderr, " -C cached pool configuration\n"); - (void) fprintf(stderr, " -i intent logs\n"); - (void) fprintf(stderr, " -b block statistics\n"); - (void) fprintf(stderr, " -m metaslabs\n"); - (void) fprintf(stderr, " -c checksum all metadata (twice for " + "Usage: %s [-CumdibcsDvhL] poolname [object...]\n" + " %s [-div] dataset [object...]\n" + " %s -m [-L] poolname [vdev [metaslab...]]\n" + " %s -R poolname vdev:offset:size[:flags]\n" + " %s -S poolname\n" + " %s -l [-u] device\n" + " %s -C\n\n", + cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname); + + (void) fprintf(stderr, " Dataset name must include at least one " + "separator character '/' or '@'\n"); + (void) fprintf(stderr, " If dataset name is specified, only that " + "dataset is dumped\n"); + (void) fprintf(stderr, " If object numbers are specified, only " + "those objects are dumped\n\n"); + (void) fprintf(stderr, " Options to control amount of output:\n"); + (void) fprintf(stderr, " -u uberblock\n"); + (void) fprintf(stderr, " -d dataset(s)\n"); + (void) fprintf(stderr, " -i intent logs\n"); + (void) fprintf(stderr, " -C config (or cachefile if alone)\n"); + (void) fprintf(stderr, " -h pool history\n"); + (void) fprintf(stderr, " -b block statistics\n"); + (void) fprintf(stderr, " -m metaslabs\n"); + (void) fprintf(stderr, " -c checksum all metadata (twice for " "all data) blocks\n"); - (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); - (void) fprintf(stderr, " -S : -- " - "dump blkptr signatures\n"); - (void) fprintf(stderr, " -v verbose (applies to all others)\n"); + (void) fprintf(stderr, " -s report stats on zdb's I/O\n"); + (void) fprintf(stderr, " -D dedup statistics\n"); + (void) fprintf(stderr, " -S simulate dedup to measure effect\n"); + (void) fprintf(stderr, " -v verbose (applies to all others)\n"); (void) fprintf(stderr, " -l dump label contents\n"); (void) fprintf(stderr, " -L disable leak tracking (do not " "load spacemaps)\n"); - (void) fprintf(stderr, " -U cachefile_path -- use alternate " - "cachefile\n"); (void) fprintf(stderr, " -R read and display block from a " - "device\n"); - (void) fprintf(stderr, " -e Pool is exported/destroyed/" - "has altroot\n"); - (void) fprintf(stderr, " -p (use with -e)\n"); - (void) fprintf(stderr, " -t highest txg to use when " + "device\n\n"); + (void) fprintf(stderr, " Below options are intended for use " + "with other options (except -l):\n"); + (void) fprintf(stderr, " -A ignore assertions (-A), enable " + "panic recovery (-AA) or both (-AAA)\n"); + (void) fprintf(stderr, " -F attempt automatic rewind within " + "safe range of transaction groups\n"); + (void) fprintf(stderr, " -U -- use alternate " + "cachefile\n"); + (void) fprintf(stderr, " -X attempt extreme rewind (does not " + "work with dataset)\n"); + (void) fprintf(stderr, " -e pool is exported/destroyed/" + "has altroot/not in a cachefile\n"); + (void) fprintf(stderr, " -p -- use one or more with " + "-e to specify path to vdev dir\n"); + (void) fprintf(stderr, " -P print numbers parsable\n"); + (void) fprintf(stderr, " -t -- highest txg to use when " "searching for uberblocks\n"); (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) " "to make only that option verbose\n"); @@ -146,68 +178,6 @@ fatal(const char *fmt, ...) exit(1); } -static void -dump_nvlist(nvlist_t *list, int indent) -{ - nvpair_t *elem = NULL; - - while ((elem = nvlist_next_nvpair(list, elem)) != NULL) { - switch (nvpair_type(elem)) { - case DATA_TYPE_STRING: - { - char *value; - - VERIFY(nvpair_value_string(elem, &value) == 0); - (void) printf("%*s%s='%s'\n", indent, "", - nvpair_name(elem), value); - } - break; - - case DATA_TYPE_UINT64: - { - uint64_t value; - - VERIFY(nvpair_value_uint64(elem, &value) == 0); - (void) printf("%*s%s=%llu\n", indent, "", - nvpair_name(elem), (u_longlong_t)value); - } - break; - - case DATA_TYPE_NVLIST: - { - nvlist_t *value; - - VERIFY(nvpair_value_nvlist(elem, &value) == 0); - (void) printf("%*s%s\n", indent, "", - nvpair_name(elem)); - dump_nvlist(value, indent + 4); - } - break; - - case DATA_TYPE_NVLIST_ARRAY: - { - nvlist_t **value; - uint_t c, count; - - VERIFY(nvpair_value_nvlist_array(elem, &value, - &count) == 0); - - for (c = 0; c < count; c++) { - (void) printf("%*s%s[%u]\n", indent, "", - nvpair_name(elem), c); - dump_nvlist(value[c], indent + 8); - } - } - break; - - default: - - (void) printf("bad config type %d for %s\n", - nvpair_type(elem), nvpair_name(elem)); - } - } -} - /* ARGSUSED */ static void dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size) @@ -227,6 +197,15 @@ dump_packed_nvlist(objset_t *os, uint64_ nvlist_free(nv); } +static void +zdb_nicenum(uint64_t num, char *buf) +{ + if (dump_opt['P']) + (void) sprintf(buf, "%llu", (longlong_t)num); + else + nicenum(num, buf); +} + const char dump_zap_stars[] = "****************************************"; const int dump_zap_width = sizeof (dump_zap_stars) - 1; @@ -325,6 +304,13 @@ dump_none(objset_t *os, uint64_t object, } /*ARGSUSED*/ +static void +dump_unknown(objset_t *os, uint64_t object, void *data, size_t size) +{ + (void) printf("\tUNKNOWN OBJECT TYPE\n"); +} + +/*ARGSUSED*/ void dump_uint8(objset_t *os, uint64_t object, void *data, size_t size) { @@ -388,6 +374,79 @@ dump_zap(objset_t *os, uint64_t object, /*ARGSUSED*/ static void +dump_ddt_zap(objset_t *os, uint64_t object, void *data, size_t size) +{ + dump_zap_stats(os, object); + /* contents are printed elsewhere, properly decoded */ +} + +/*ARGSUSED*/ +static void +dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = ", attr.za_name); + if (attr.za_num_integers == 0) { + (void) printf("\n"); + continue; + } + (void) printf(" %llx : [%d:%d:%d]\n", + (u_longlong_t)attr.za_first_integer, + (int)ATTR_LENGTH(attr.za_first_integer), + (int)ATTR_BSWAP(attr.za_first_integer), + (int)ATTR_NUM(attr.za_first_integer)); + } + zap_cursor_fini(&zc); +} + +/*ARGSUSED*/ +static void +dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size) +{ + zap_cursor_t zc; + zap_attribute_t attr; + uint16_t *layout_attrs; + int i; + + dump_zap_stats(os, object); + (void) printf("\n"); + + for (zap_cursor_init(&zc, os, object); + zap_cursor_retrieve(&zc, &attr) == 0; + zap_cursor_advance(&zc)) { + (void) printf("\t\t%s = [", attr.za_name); + if (attr.za_num_integers == 0) { + (void) printf("\n"); + continue; + } + + VERIFY(attr.za_integer_length == 2); + layout_attrs = umem_zalloc(attr.za_num_integers * + attr.za_integer_length, UMEM_NOFAIL); + + VERIFY(zap_lookup(os, object, attr.za_name, + attr.za_integer_length, + attr.za_num_integers, layout_attrs) == 0); + + for (i = 0; i != attr.za_num_integers; i++) + (void) printf(" %d ", (int)layout_attrs[i]); + (void) printf("]\n"); + umem_free(layout_attrs, + attr.za_num_integers * attr.za_integer_length); + } + zap_cursor_fini(&zc); +} + +/*ARGSUSED*/ +static void dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size) { zap_cursor_t zc; @@ -441,17 +500,17 @@ dump_spacemap(objset_t *os, space_map_ob */ alloc = 0; for (offset = 0; offset < smo->smo_objsize; offset += sizeof (entry)) { - VERIFY(0 == dmu_read(os, smo->smo_object, offset, + VERIFY3U(0, ==, dmu_read(os, smo->smo_object, offset, sizeof (entry), &entry, DMU_READ_PREFETCH)); if (SM_DEBUG_DECODE(entry)) { - (void) printf("\t\t[%4llu] %s: txg %llu, pass %llu\n", + (void) printf("\t [%6llu] %s: txg %llu, pass %llu\n", (u_longlong_t)(offset / sizeof (entry)), ddata[SM_DEBUG_ACTION_DECODE(entry)], (u_longlong_t)SM_DEBUG_TXG_DECODE(entry), (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry)); } else { - (void) printf("\t\t[%4llu] %c range:" - " %08llx-%08llx size: %06llx\n", + (void) printf("\t [%6llu] %c range:" + " %010llx-%010llx size: %06llx\n", (u_longlong_t)(offset / sizeof (entry)), SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F', (u_longlong_t)((SM_OFFSET_DECODE(entry) << @@ -476,14 +535,14 @@ dump_spacemap(objset_t *os, space_map_ob static void dump_metaslab_stats(metaslab_t *msp) { - char maxbuf[5]; + char maxbuf[32]; space_map_t *sm = &msp->ms_map; avl_tree_t *t = sm->sm_pp_root; int free_pct = sm->sm_space * 100 / sm->sm_size; - nicenum(space_map_maxsize(sm), maxbuf); + zdb_nicenum(space_map_maxsize(sm), maxbuf); - (void) printf("\t %20s %10lu %7s %6s %4s %4d%%\n", + (void) printf("\t %25s %10lu %7s %6s %4s %4d%%\n", "segments", avl_numnodes(t), "maxsize", maxbuf, "freepct", free_pct); } @@ -495,16 +554,16 @@ dump_metaslab(metaslab_t *msp) spa_t *spa = vd->vdev_spa; space_map_t *sm = &msp->ms_map; space_map_obj_t *smo = &msp->ms_smo; - char freebuf[5]; + char freebuf[32]; - nicenum(sm->sm_size - smo->smo_alloc, freebuf); + zdb_nicenum(sm->sm_size - smo->smo_alloc, freebuf); (void) printf( - "\tvdev %5llu offset %12llx spacemap %6llu free %5s\n", + "\tmetaslab %6llu offset %12llx spacemap %6llu free %5s\n", (u_longlong_t)(sm->sm_start / sm->sm_size), (u_longlong_t)sm->sm_start, (u_longlong_t)smo->smo_object, freebuf); - if (dump_opt['m'] > 1) { + if (dump_opt['m'] > 1 && !dump_opt['L']) { mutex_enter(&msp->ms_lock); space_map_load_wait(sm); if (!sm->sm_loaded) @@ -525,22 +584,52 @@ dump_metaslab(metaslab_t *msp) } static void +print_vdev_metaslab_header(vdev_t *vd) +{ + (void) printf("\tvdev %10llu\n\t%-10s%5llu %-19s %-15s %-10s\n", + (u_longlong_t)vd->vdev_id, + "metaslabs", (u_longlong_t)vd->vdev_ms_count, + "offset", "spacemap", "free"); + (void) printf("\t%15s %19s %15s %10s\n", + "---------------", "-------------------", + "---------------", "-------------"); +} + +static void dump_metaslabs(spa_t *spa) { - vdev_t *rvd = spa->spa_root_vdev; - vdev_t *vd; - int c, m; + vdev_t *vd, *rvd = spa->spa_root_vdev; + uint64_t m, c = 0, children = rvd->vdev_children; (void) printf("\nMetaslabs:\n"); - for (c = 0; c < rvd->vdev_children; c++) { - vd = rvd->vdev_child[c]; + if (!dump_opt['d'] && zopt_objects > 0) { + c = zopt_object[0]; - (void) printf("\t%-10s %-19s %-15s %-10s\n", - "vdev", "offset", "spacemap", "free"); - (void) printf("\t%10s %19s %15s %10s\n", - "----------", "-------------------", - "---------------", "-------------"); + if (c >= children) + (void) fatal("bad vdev id: %llu", (u_longlong_t)c); + + if (zopt_objects > 1) { + vd = rvd->vdev_child[c]; + print_vdev_metaslab_header(vd); + + for (m = 1; m < zopt_objects; m++) { + if (zopt_object[m] < vd->vdev_ms_count) + dump_metaslab( + vd->vdev_ms[zopt_object[m]]); + else + (void) fprintf(stderr, "bad metaslab " + "number %llu\n", + (u_longlong_t)zopt_object[m]); + } + (void) printf("\n"); + return; + } + children = c + 1; + } + for (; c < children; c++) { + vd = rvd->vdev_child[c]; + print_vdev_metaslab_header(vd); for (m = 0; m < vd->vdev_ms_count; m++) dump_metaslab(vd->vdev_ms[m]); @@ -549,6 +638,133 @@ dump_metaslabs(spa_t *spa) } static void +dump_dde(const ddt_t *ddt, const ddt_entry_t *dde, uint64_t index) +{ + const ddt_phys_t *ddp = dde->dde_phys; + const ddt_key_t *ddk = &dde->dde_key; + char *types[4] = { "ditto", "single", "double", "triple" }; + char blkbuf[BP_SPRINTF_LEN]; + blkptr_t blk; + + for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) { + if (ddp->ddp_phys_birth == 0) + continue; + ddt_bp_create(ddt->ddt_checksum, ddk, ddp, &blk); + sprintf_blkptr(blkbuf, &blk); + (void) printf("index %llx refcnt %llu %s %s\n", + (u_longlong_t)index, (u_longlong_t)ddp->ddp_refcnt, + types[p], blkbuf); + } +} + +static void +dump_dedup_ratio(const ddt_stat_t *dds) +{ + double rL, rP, rD, D, dedup, compress, copies; + + if (dds->dds_blocks == 0) + return; + + rL = (double)dds->dds_ref_lsize; + rP = (double)dds->dds_ref_psize; + rD = (double)dds->dds_ref_dsize; + D = (double)dds->dds_dsize; + + dedup = rD / D; + compress = rL / rP; + copies = rD / rP; + + (void) printf("dedup = %.2f, compress = %.2f, copies = %.2f, " + "dedup * compress / copies = %.2f\n\n", + dedup, compress, copies, dedup * compress / copies); +} + +static void +dump_ddt(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +{ + char name[DDT_NAMELEN]; + ddt_entry_t dde; + uint64_t walk = 0; + dmu_object_info_t doi; + uint64_t count, dspace, mspace; + int error; + + error = ddt_object_info(ddt, type, class, &doi); + + if (error == ENOENT) + return; + ASSERT(error == 0); + + if ((count = ddt_object_count(ddt, type, class)) == 0) + return; + + dspace = doi.doi_physical_blocks_512 << 9; + mspace = doi.doi_fill_count * doi.doi_data_block_size; + + ddt_object_name(ddt, type, class, name); + + (void) printf("%s: %llu entries, size %llu on disk, %llu in core\n", + name, + (u_longlong_t)count, + (u_longlong_t)(dspace / count), + (u_longlong_t)(mspace / count)); + + if (dump_opt['D'] < 3) + return; + + zpool_dump_ddt(NULL, &ddt->ddt_histogram[type][class]); + + if (dump_opt['D'] < 4) + return; + + if (dump_opt['D'] < 5 && class == DDT_CLASS_UNIQUE) + return; + + (void) printf("%s contents:\n\n", name); + + while ((error = ddt_object_walk(ddt, type, class, &walk, &dde)) == 0) + dump_dde(ddt, &dde, walk); + + ASSERT(error == ENOENT); + + (void) printf("\n"); +} + +static void +dump_all_ddts(spa_t *spa) +{ + ddt_histogram_t ddh_total = { 0 }; + ddt_stat_t dds_total = { 0 }; + + for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) { + ddt_t *ddt = spa->spa_ddt[c]; + for (enum ddt_type type = 0; type < DDT_TYPES; type++) { + for (enum ddt_class class = 0; class < DDT_CLASSES; + class++) { + dump_ddt(ddt, type, class); + } + } + } + + ddt_get_dedup_stats(spa, &dds_total); + + if (dds_total.dds_blocks == 0) { + (void) printf("All DDTs are empty\n"); + return; + } + + (void) printf("\n"); + + if (dump_opt['D'] > 1) { + (void) printf("DDT histogram (aggregated over all DDTs):\n"); + ddt_get_dedup_histogram(spa, &ddh_total); + zpool_dump_ddt(&dds_total, &ddh_total); + } + + dump_dedup_ratio(&dds_total); +} + +static void dump_dtl_seg(space_map_t *sm, uint64_t start, uint64_t size) { char *prefix = (void *)sm; @@ -568,7 +784,7 @@ dump_dtl(vdev_t *vd, int indent) char *name[DTL_TYPES] = { "missing", "partial", "scrub", "outage" }; char prefix[256]; - spa_vdev_state_enter(spa); + spa_vdev_state_enter(spa, SCL_NONE); required = vdev_dtl_required(vd); (void) spa_vdev_state_exit(spa, NULL, 0); @@ -598,6 +814,68 @@ dump_dtl(vdev_t *vd, int indent) dump_dtl(vd->vdev_child[c], indent + 4); } +static void +dump_history(spa_t *spa) +{ + nvlist_t **events = NULL; + char buf[SPA_MAXBLOCKSIZE]; + uint64_t resid, len, off = 0; + uint_t num = 0; + int error; + time_t tsec; + struct tm t; + char tbuf[30]; + char internalstr[MAXPATHLEN]; + + do { + len = sizeof (buf); + + if ((error = spa_history_get(spa, &off, &len, buf)) != 0) { + (void) fprintf(stderr, "Unable to read history: " + "error %d\n", error); + return; + } + + if (zpool_history_unpack(buf, len, &resid, &events, &num) != 0) + break; + + off -= resid; + } while (len != 0); + + (void) printf("\nHistory:\n"); + for (int i = 0; i < num; i++) { + uint64_t time, txg, ievent; + char *cmd, *intstr; + + if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME, + &time) != 0) + continue; + if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD, + &cmd) != 0) { + if (nvlist_lookup_uint64(events[i], + ZPOOL_HIST_INT_EVENT, &ievent) != 0) + continue; + verify(nvlist_lookup_uint64(events[i], + ZPOOL_HIST_TXG, &txg) == 0); + verify(nvlist_lookup_string(events[i], + ZPOOL_HIST_INT_STR, &intstr) == 0); + if (ievent >= LOG_END) + continue; + + (void) snprintf(internalstr, + sizeof (internalstr), + "[internal %s txg:%lld] %s", + zfs_history_event_names[ievent], txg, + intstr); + cmd = internalstr; + } + tsec = time; + (void) localtime_r(&tsec, &t); + (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t); + (void) printf("%s %s\n", tbuf, cmd); + } +} + /*ARGSUSED*/ static void dump_dnode(objset_t *os, uint64_t object, void *data, size_t size) @@ -605,35 +883,48 @@ dump_dnode(objset_t *os, uint64_t object } static uint64_t -blkid2offset(const dnode_phys_t *dnp, int level, uint64_t blkid) +blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp, const zbookmark_t *zb) { - if (level < 0) - return (blkid); + if (dnp == NULL) { + ASSERT(zb->zb_level < 0); + if (zb->zb_object == 0) + return (zb->zb_blkid); + return (zb->zb_blkid * BP_GET_LSIZE(bp)); + } + + ASSERT(zb->zb_level >= 0); - return ((blkid << (level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) * + return ((zb->zb_blkid << + (zb->zb_level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) * dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT); } static void -sprintf_blkptr_compact(char *blkbuf, blkptr_t *bp, int alldvas) +sprintf_blkptr_compact(char *blkbuf, const blkptr_t *bp) { - dva_t *dva = bp->blk_dva; - int ndvas = alldvas ? BP_GET_NDVAS(bp) : 1; - int i; + const dva_t *dva = bp->blk_dva; + int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1; + + if (dump_opt['b'] >= 5) { + sprintf_blkptr(blkbuf, bp); + return; + } blkbuf[0] = '\0'; - for (i = 0; i < ndvas; i++) + for (int i = 0; i < ndvas; i++) (void) sprintf(blkbuf + strlen(blkbuf), "%llu:%llx:%llx ", (u_longlong_t)DVA_GET_VDEV(&dva[i]), (u_longlong_t)DVA_GET_OFFSET(&dva[i]), (u_longlong_t)DVA_GET_ASIZE(&dva[i])); - (void) sprintf(blkbuf + strlen(blkbuf), "%llxL/%llxP F=%llu B=%llu", + (void) sprintf(blkbuf + strlen(blkbuf), + "%llxL/%llxP F=%llu B=%llu/%llu", (u_longlong_t)BP_GET_LSIZE(bp), (u_longlong_t)BP_GET_PSIZE(bp), (u_longlong_t)bp->blk_fill, - (u_longlong_t)bp->blk_birth); + (u_longlong_t)bp->blk_birth, + (u_longlong_t)BP_PHYSICAL_BIRTH(bp)); } static void @@ -646,8 +937,7 @@ print_indirect(blkptr_t *bp, const zbook ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type); ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level); - (void) printf("%16llx ", - (u_longlong_t)blkid2offset(dnp, zb->zb_level, zb->zb_blkid)); + (void) printf("%16llx ", (u_longlong_t)blkid2offset(dnp, bp, zb)); ASSERT(zb->zb_level >= 0); @@ -659,23 +949,15 @@ print_indirect(blkptr_t *bp, const zbook } } - sprintf_blkptr_compact(blkbuf, bp, dump_opt['d'] > 5 ? 1 : 0); + sprintf_blkptr_compact(blkbuf, bp); (void) printf("%s\n", blkbuf); } -#define SET_BOOKMARK(zb, objset, object, level, blkid) \ -{ \ - (zb)->zb_objset = objset; \ - (zb)->zb_object = object; \ - (zb)->zb_level = level; \ - (zb)->zb_blkid = blkid; \ -} - static int visit_indirect(spa_t *spa, const dnode_phys_t *dnp, blkptr_t *bp, const zbookmark_t *zb) { - int err; + int err = 0; if (bp->blk_birth == 0) return (0); @@ -694,6 +976,7 @@ visit_indirect(spa_t *spa, const dnode_p ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb); if (err) return (err); + ASSERT(buf->b_data); /* recursively visit blocks below this */ cbp = buf->b_data; @@ -726,11 +1009,11 @@ dump_indirect(dnode_t *dn) (void) printf("Indirect blocks:\n"); - SET_BOOKMARK(&czb, dmu_objset_id(&dn->dn_objset->os), + SET_BOOKMARK(&czb, dmu_objset_id(dn->dn_objset), dn->dn_object, dnp->dn_nlevels - 1, 0); for (j = 0; j < dnp->dn_nblkptr; j++) { czb.zb_blkid = j; - (void) visit_indirect(dmu_objset_spa(&dn->dn_objset->os), dnp, + (void) visit_indirect(dmu_objset_spa(dn->dn_objset), dnp, &dnp->dn_blkptr[j], &czb); } @@ -743,7 +1026,7 @@ dump_dsl_dir(objset_t *os, uint64_t obje { dsl_dir_phys_t *dd = data; time_t crtime; - char nice[6]; *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***