changeset 5886:fe556dc3c14d onnv_82

backout 6575965/6600361: needs more work
author dm120769
date Tue, 22 Jan 2008 20:40:37 -0800
parents 4bdc6d36b881
children 5202e2560ba9
files deleted_files/usr/src/common/zfs/zfs_util.c deleted_files/usr/src/common/zfs/zfs_util.h usr/src/cmd/zpool/zpool_main.c usr/src/common/zfs/zfs_util.c usr/src/common/zfs/zfs_util.h usr/src/lib/libzfs/Makefile.com usr/src/lib/libzfs/common/mapfile-vers usr/src/uts/common/Makefile.files usr/src/uts/common/fs/zfs/spa.c usr/src/uts/common/fs/zfs/zil.c
diffstat 10 files changed, 118 insertions(+), 124 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deleted_files/usr/src/common/zfs/zfs_util.c	Tue Jan 22 20:40:37 2008 -0800
@@ -0,0 +1,65 @@
+/*
+ * 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 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+/*
+ * This file is intended for functions that ought to be shared between user
+ * land (libzfs) and the kernel. When many common routines need to be shared
+ * then a separate file should to be created.
+ */
+
+#if defined(_KERNEL)
+#include <sys/systm.h>
+#endif
+
+#include <sys/types.h>
+#include <sys/fs/zfs.h>
+#include <sys/nvpair.h>
+
+/*
+ * Are there allocatable vdevs?
+ */
+boolean_t
+zfs_allocatable_devs(nvlist_t *nv)
+{
+	uint64_t is_log;
+	uint_t c;
+	nvlist_t **child;
+	uint_t children;
+
+	if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
+	    &child, &children) != 0) {
+		return (B_FALSE);
+	}
+	for (c = 0; c < children; c++) {
+		is_log = 0;
+		(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
+		    &is_log);
+		if (!is_log)
+			return (B_TRUE);
+	}
+	return (B_FALSE);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deleted_files/usr/src/common/zfs/zfs_util.h	Tue Jan 22 20:40:37 2008 -0800
@@ -0,0 +1,44 @@
+/*
+ * 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 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#ifndef	_ZFS_UTIL_H
+#define	_ZFS_UTIL_H
+
+#pragma ident	"%Z%%M%	%I%	%E% SMI"
+
+#include <sys/fs/zfs.h>
+#include <sys/types.h>
+
+#ifdef	__cplusplus
+extern "C" {
+#endif
+
+extern boolean_t zfs_allocatable_devs(nvlist_t *nv);
+
+#ifdef	__cplusplus
+}
+#endif
+
+#endif	/* _ZFS_UTIL_H */
--- a/usr/src/cmd/zpool/zpool_main.c	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/cmd/zpool/zpool_main.c	Tue Jan 22 20:40:37 2008 -0800
@@ -560,6 +560,8 @@
 	int ret = 1;
 	char *altroot = NULL;
 	char *mountpoint = NULL;
+	nvlist_t **child;
+	uint_t children;
 	nvlist_t *props = NULL;
 	char *propval;
 
@@ -645,7 +647,9 @@
 		return (1);
 
 	/* make_root_vdev() allows 0 toplevel children if there are spares */
-	if (!zfs_allocatable_devs(nvroot)) {
+	verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
+	    &child, &children) == 0);
+	if (children == 0) {
 		(void) fprintf(stderr, gettext("invalid vdev "
 		    "specification: at least one toplevel vdev must be "
 		    "specified\n"));
--- a/usr/src/common/zfs/zfs_util.c	Tue Jan 22 20:00:59 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,65 +0,0 @@
-/*
- * 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 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-/*
- * This file is intended for functions that ought to be shared between user
- * land (libzfs) and the kernel. When many common routines need to be shared
- * then a separate file should to be created.
- */
-
-#if defined(_KERNEL)
-#include <sys/systm.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/fs/zfs.h>
-#include <sys/nvpair.h>
-
-/*
- * Are there allocatable vdevs?
- */
-boolean_t
-zfs_allocatable_devs(nvlist_t *nv)
-{
-	uint64_t is_log;
-	uint_t c;
-	nvlist_t **child;
-	uint_t children;
-
-	if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-	    &child, &children) != 0) {
-		return (B_FALSE);
-	}
-	for (c = 0; c < children; c++) {
-		is_log = 0;
-		(void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-		    &is_log);
-		if (!is_log)
-			return (B_TRUE);
-	}
-	return (B_FALSE);
-}
--- a/usr/src/common/zfs/zfs_util.h	Tue Jan 22 20:00:59 2008 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * 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 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef	_ZFS_UTIL_H
-#define	_ZFS_UTIL_H
-
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#include <sys/fs/zfs.h>
-#include <sys/types.h>
-
-#ifdef	__cplusplus
-extern "C" {
-#endif
-
-extern boolean_t zfs_allocatable_devs(nvlist_t *nv);
-
-#ifdef	__cplusplus
-}
-#endif
-
-#endif	/* _ZFS_UTIL_H */
--- a/usr/src/lib/libzfs/Makefile.com	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/lib/libzfs/Makefile.com	Tue Jan 22 20:40:37 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -28,8 +28,7 @@
 LIBRARY= libzfs.a
 VERS= .1
 
-OBJS_SHARED= zfs_namecheck.o zprop_common.o zfs_prop.o zpool_prop.o \
-	zfs_deleg.o zfs_util.o
+OBJS_SHARED= zfs_namecheck.o zprop_common.o zfs_prop.o zpool_prop.o zfs_deleg.o
 OBJS_COMMON= libzfs_dataset.o libzfs_util.o libzfs_graph.o libzfs_mount.o \
 	libzfs_pool.o libzfs_changelist.o libzfs_config.o libzfs_import.o \
 	libzfs_status.o libzfs_sendrecv.o
--- a/usr/src/lib/libzfs/common/mapfile-vers	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/lib/libzfs/common/mapfile-vers	Tue Jan 22 20:40:37 2008 -0800
@@ -19,7 +19,7 @@
 # CDDL HEADER END
 #
 #
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
 # ident	"%Z%%M%	%I%	%E% SMI"
@@ -33,7 +33,6 @@
 	libzfs_fini;
 	libzfs_init;
 	libzfs_print_on_error;
-	zfs_allocatable_devs;
 	zfs_build_perms;
 	zfs_clone;
 	zfs_close;
--- a/usr/src/uts/common/Makefile.files	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/uts/common/Makefile.files	Tue Jan 22 20:40:37 2008 -0800
@@ -1121,7 +1121,6 @@
 	zfs_namecheck.o		\
 	zfs_deleg.o		\
 	zfs_prop.o		\
-	zfs_util.o		\
 	zpool_prop.o		\
 	zprop_common.o
 
--- a/usr/src/uts/common/fs/zfs/spa.c	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/uts/common/fs/zfs/spa.c	Tue Jan 22 20:40:37 2008 -0800
@@ -62,7 +62,6 @@
 #include <sys/sunddi.h>
 
 #include "zfs_prop.h"
-#include "zfs_util.h"
 
 int zio_taskq_threads = 8;
 
@@ -1933,7 +1932,7 @@
 	ASSERT(error != 0 || rvd != NULL);
 	ASSERT(error != 0 || spa->spa_root_vdev == rvd);
 
-	if (error == 0 && !zfs_allocatable_devs(nvroot))
+	if (error == 0 && rvd->vdev_children == 0)
 		error = EINVAL;
 
 	if (error == 0 &&
--- a/usr/src/uts/common/fs/zfs/zil.c	Tue Jan 22 20:00:59 2008 -0800
+++ b/usr/src/uts/common/fs/zfs/zil.c	Tue Jan 22 20:40:37 2008 -0800
@@ -1215,9 +1215,6 @@
 	avl_create(&zilog->zl_vdev_tree, zil_vdev_compare,
 	    sizeof (zil_vdev_node_t), offsetof(zil_vdev_node_t, zv_node));
 
-	cv_init(&zilog->zl_cv_writer, NULL, CV_DEFAULT, NULL);
-	cv_init(&zilog->zl_cv_suspend, NULL, CV_DEFAULT, NULL);
-
 	return (zilog);
 }
 
@@ -1243,9 +1240,6 @@
 	list_destroy(&zilog->zl_itx_list);
 	mutex_destroy(&zilog->zl_lock);
 
-	cv_destroy(&zilog->zl_cv_writer);
-	cv_destroy(&zilog->zl_cv_suspend);
-
 	kmem_free(zilog, sizeof (zilog_t));
 }