summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authordm120769 <none@none>2008-01-22 20:40:37 -0800
committerdm120769 <none@none>2008-01-22 20:40:37 -0800
commit85dc7ea5e05c7627ea92c11ccb34fd22efd21452 (patch)
treeaf98626a9dfbd445e216b2d7d8aa777854b849af /usr/src
parent573b0c00a1ee520c3f6938dda8d693236f37ae60 (diff)
downloadillumos-joyent-85dc7ea5e05c7627ea92c11ccb34fd22efd21452.tar.gz
backout 6575965/6600361: needs more work
--HG-- rename : usr/src/common/zfs/zfs_util.c => deleted_files/usr/src/common/zfs/zfs_util.c rename : usr/src/common/zfs/zfs_util.h => deleted_files/usr/src/common/zfs/zfs_util.h
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zpool/zpool_main.c6
-rw-r--r--usr/src/common/zfs/zfs_util.c65
-rw-r--r--usr/src/common/zfs/zfs_util.h44
-rw-r--r--usr/src/lib/libzfs/Makefile.com5
-rw-r--r--usr/src/lib/libzfs/common/mapfile-vers3
-rw-r--r--usr/src/uts/common/Makefile.files1
-rw-r--r--usr/src/uts/common/fs/zfs/spa.c3
-rw-r--r--usr/src/uts/common/fs/zfs/zil.c6
8 files changed, 9 insertions, 124 deletions
diff --git a/usr/src/cmd/zpool/zpool_main.c b/usr/src/cmd/zpool/zpool_main.c
index 1d675cf0be..1140c46903 100644
--- a/usr/src/cmd/zpool/zpool_main.c
+++ b/usr/src/cmd/zpool/zpool_main.c
@@ -560,6 +560,8 @@ zpool_do_create(int argc, char **argv)
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 @@ zpool_do_create(int argc, char **argv)
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"));
diff --git a/usr/src/common/zfs/zfs_util.c b/usr/src/common/zfs/zfs_util.c
deleted file mode 100644
index 7eebbe8795..0000000000
--- a/usr/src/common/zfs/zfs_util.c
+++ /dev/null
@@ -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);
-}
diff --git a/usr/src/common/zfs/zfs_util.h b/usr/src/common/zfs/zfs_util.h
deleted file mode 100644
index 976cbcfe76..0000000000
--- a/usr/src/common/zfs/zfs_util.h
+++ /dev/null
@@ -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 */
diff --git a/usr/src/lib/libzfs/Makefile.com b/usr/src/lib/libzfs/Makefile.com
index 425e74bf00..908a6e981d 100644
--- a/usr/src/lib/libzfs/Makefile.com
+++ b/usr/src/lib/libzfs/Makefile.com
@@ -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
diff --git a/usr/src/lib/libzfs/common/mapfile-vers b/usr/src/lib/libzfs/common/mapfile-vers
index 41f5d25fa8..4c497cb0a4 100644
--- a/usr/src/lib/libzfs/common/mapfile-vers
+++ b/usr/src/lib/libzfs/common/mapfile-vers
@@ -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 @@ SUNWprivate_1.1 {
libzfs_fini;
libzfs_init;
libzfs_print_on_error;
- zfs_allocatable_devs;
zfs_build_perms;
zfs_clone;
zfs_close;
diff --git a/usr/src/uts/common/Makefile.files b/usr/src/uts/common/Makefile.files
index a90fa2a4e6..5beed63ce0 100644
--- a/usr/src/uts/common/Makefile.files
+++ b/usr/src/uts/common/Makefile.files
@@ -1121,7 +1121,6 @@ ZFS_SHARED_OBJS += \
zfs_namecheck.o \
zfs_deleg.o \
zfs_prop.o \
- zfs_util.o \
zpool_prop.o \
zprop_common.o
diff --git a/usr/src/uts/common/fs/zfs/spa.c b/usr/src/uts/common/fs/zfs/spa.c
index 7e323e3338..e7f4f72f44 100644
--- a/usr/src/uts/common/fs/zfs/spa.c
+++ b/usr/src/uts/common/fs/zfs/spa.c
@@ -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 @@ spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
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 &&
diff --git a/usr/src/uts/common/fs/zfs/zil.c b/usr/src/uts/common/fs/zfs/zil.c
index 6da23af23f..f5ab43a4b2 100644
--- a/usr/src/uts/common/fs/zfs/zil.c
+++ b/usr/src/uts/common/fs/zfs/zil.c
@@ -1215,9 +1215,6 @@ zil_alloc(objset_t *os, zil_header_t *zh_phys)
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 @@ zil_free(zilog_t *zilog)
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));
}