diff --git a/cmd/raidz_test/raidz_test.c b/cmd/raidz_test/raidz_test.c index cf3e123c6..4839e909e 100644 --- a/cmd/raidz_test/raidz_test.c +++ b/cmd/raidz_test/raidz_test.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "raidz_test.h" static int *rand_data; diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index fa8e7fa69..09e144f66 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -89,6 +89,7 @@ #include #include +#include #include #include #include diff --git a/cmd/zhack.c b/cmd/zhack.c index 8ffbf91ff..536e38807 100644 --- a/cmd/zhack.c +++ b/cmd/zhack.c @@ -55,6 +55,7 @@ #include #include #include +#include static importargs_t g_importargs; static char *g_pool; diff --git a/cmd/ztest.c b/cmd/ztest.c index 89b1f6860..54b4fdb4c 100644 --- a/cmd/ztest.c +++ b/cmd/ztest.c @@ -139,6 +139,7 @@ #include #include #include +#include static int ztest_fd_data = -1; static int ztest_fd_rand = -1; diff --git a/include/Makefile.am b/include/Makefile.am index 7588cd0ae..42457519e 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -191,6 +191,7 @@ USER_H = \ libzfs.h \ libzfs_core.h \ libzfsbootenv.h \ + libzpool.h \ libzutil.h \ thread_pool.h diff --git a/include/libzpool.h b/include/libzpool.h new file mode 100644 index 000000000..3fd6c694d --- /dev/null +++ b/include/libzpool.h @@ -0,0 +1,49 @@ +// SPDX-License-Identifier: CDDL-1.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 https://opensource.org/licenses/CDDL-1.0. + * 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 (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2011 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, Joyent, Inc. All rights reserved. + */ + +#ifndef _LIBZPOOL_H +#define _LIBZPOOL_H extern __attribute__((visibility("default"))) + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +_LIBZPOOL_H void kernel_init(int mode); +_LIBZPOOL_H void kernel_fini(void); + +struct spa; +_LIBZPOOL_H void show_pool_stats(struct spa *); +_LIBZPOOL_H int handle_tunable_option(const char *, boolean_t); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h index 49d3b207a..ef5899b11 100644 --- a/include/sys/zfs_context.h +++ b/include/sys/zfs_context.h @@ -230,15 +230,9 @@ random_in_range(uint32_t range) return (r % range); } -extern void kernel_init(int mode); -extern void kernel_fini(void); extern void random_init(void); extern void random_fini(void); -struct spa; -extern void show_pool_stats(struct spa *); -extern int handle_tunable_option(const char *, boolean_t); - typedef struct callb_cpr { kmutex_t *cc_lockp; } callb_cpr_t; diff --git a/lib/libzpool/kernel.c b/lib/libzpool/kernel.c index d73495203..d7ff74cba 100644 --- a/lib/libzpool/kernel.c +++ b/lib/libzpool/kernel.c @@ -45,6 +45,9 @@ #include #include #include + +#include +#include #include #include #include diff --git a/lib/libzpool/util.c b/lib/libzpool/util.c index 66d6f4396..a0b4480c4 100644 --- a/lib/libzpool/util.c +++ b/lib/libzpool/util.c @@ -38,6 +38,7 @@ #include #include #include +#include /* * Routines needed by more than one client of libzpool.