Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
2d73388
libspl: single zfs_context_os.h
robn Jul 6, 2025
3e11144
libzpool: move zfs_context_os.h from libspl
robn Oct 26, 2025
424f708
libzpool: move ZFS-specific headers from libspl
robn Oct 26, 2025
1919769
libspl: move time definitions from zfs_context_os.h
robn Oct 16, 2025
c63ad01
libspl: move mutex headers from zfs_context.h
robn Aug 8, 2025
0fef9bb
libspl: move mutex implementation from libzpool
robn Oct 26, 2025
5b4dacc
libspl: move rwlock definitions from zfs_context.h
robn Aug 8, 2025
7bec406
libspl: move rwlock implementation from libzpool
robn Oct 26, 2025
0e4b92a
libspl: move condvar definitions from zfs_context.h
robn Aug 8, 2025
498bc45
libspl: move condvar implementation from libzpool
robn Oct 26, 2025
596bfd1
libspl: move cmn_err definitions from zfs_context.h
robn Aug 9, 2025
fa44ee8
libspl: move thread definitions from zfs_context.h
robn Aug 25, 2025
aef5147
libspl: move thread implementation from libzpool
robn Oct 27, 2025
6f24f2a
libspl: move taskq definitions from zfs_context.h
robn Aug 16, 2025
0251691
libspl: move taskq implementation from libzpool
robn Oct 26, 2025
c95d557
libspl: move cred definitions from zfs_context.h
robn Aug 25, 2025
d7dd267
libspl: move cred implementation from libzpool
robn Oct 27, 2025
4796b35
libspl: move tsd definitions from zfs_context.h
robn Oct 15, 2025
d9c0473
libspl: move kstat definitions from zfs_context.h, slim down to basics
robn Oct 16, 2025
ec37bce
libspl: move kstat implementation from libzpool
robn Oct 27, 2025
986cd30
libspl: move procfs_list definitions from zfs_context.h
robn Oct 16, 2025
0c2ed43
libspl: move procfs_list implementation from libzpool
robn Oct 27, 2025
8bfa660
libspl: move kmem definitions from zfs_context.h
robn Oct 16, 2025
1fda610
libspl: move kmem implementation from libzpool
robn Oct 27, 2025
6bc7f84
libspl: move vattr and xvattr definitions from zfs_context.h; enable …
robn Oct 17, 2025
473aabb
libspl: add include guards for sys/string.h
robn Oct 22, 2025
2c19222
libspl: move ptob() from zfs_context.h
robn Oct 18, 2025
99e0129
zfs_context: remove duplicated access control stuff; remove kernel gate
robn Oct 18, 2025
94b9c62
libzpool: separate driver-side include
robn Oct 24, 2025
2bc2008
libspl: init/fini
robn Oct 24, 2025
44e1ee7
libspl: move physmem to sys/systm.h; initialise at libspl_init()
robn Oct 24, 2025
8168874
libspl: move utsname() etc to sys/misc.h; initialise in libspl_init()
robn Oct 24, 2025
fe3cd80
zfs_context: move vn_dumpdir to libzpool
robn Oct 24, 2025
6271c94
libspl: move random definitions from zfs_context.h
robn Oct 18, 2025
025e900
libspl: move random impl from libzpool
robn Oct 24, 2025
0aafa1c
libspl: move callb stubs from zfs_context.h
robn Oct 18, 2025
531c854
libspl: move SID definitions from zfs_context.h; remove kernel gate
robn Oct 19, 2025
9e7e8e5
libspl: move SID implementation from libzpool
robn Oct 27, 2025
9cfdaee
libspl: move zone definitions from zfs_context.h
robn Oct 19, 2025
74c3a09
libzpool: remove unused userspace ioctl policy functions
robn Oct 19, 2025
c679275
zfs_context: remove misc unused
robn Oct 19, 2025
052c047
libspl: move remaining ddi_* prototypes from zfs_context.h
robn Oct 19, 2025
cf444b6
libspl: move DTRACE_PROBE macros from zfs_context.h
robn Oct 19, 2025
d25526b
libspl: common sysmacros.h
robn Oct 19, 2025
36069ca
libzutil: move NN_NUMBUF_SZ from zfs_context.h nearer to nicenum()
robn Oct 19, 2025
e64509f
libspl: move compiler attribute macros from zfs_context.h
robn Oct 19, 2025
ff220d3
zfs_context: move empty __init/__exit macros to sys/debug.h
robn Oct 19, 2025
aad9cab
libspl: move loff_t declaration from zfs_context.h
robn Oct 19, 2025
0f0427c
debug: move all of the debug bits out of the spl
behlendorf Oct 31, 2025
9f324fb
libzpool: remove global libzpool includes
behlendorf Oct 31, 2025
a9fc0c3
icp: remove global icp includes
behlendorf Oct 31, 2025
fa7ff13
zfs_context: remove duplicate includes
behlendorf Oct 31, 2025
73498ea
lib: update ABI meta following libspl changes
robn Nov 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/raidz_test/raidz_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <sys/vdev_raidz_impl.h>
#include <assert.h>
#include <stdio.h>
#include <libzpool.h>
#include "raidz_test.h"

static int *rand_data;
Expand Down
1 change: 1 addition & 0 deletions cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
#include <sys/zstd/zstd.h>
#include <sys/backtrace.h>

#include <libzpool.h>
#include <libnvpair.h>
#include <libzutil.h>
#include <libzfs_core.h>
Expand Down
2 changes: 2 additions & 0 deletions cmd/zed/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ include $(srcdir)/%D%/zed.d/Makefile.am
zed_CFLAGS = $(AM_CFLAGS)
zed_CFLAGS += $(LIBUDEV_CFLAGS) $(LIBUUID_CFLAGS)

zed_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)

sbin_PROGRAMS += zed
CPPCHECKTARGETS += zed

Expand Down
1 change: 1 addition & 0 deletions cmd/zhack.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#include <zfeature_common.h>
#include <libzutil.h>
#include <sys/metaslab_impl.h>
#include <libzpool.h>

static importargs_t g_importargs;
static char *g_pool;
Expand Down
2 changes: 2 additions & 0 deletions cmd/zinject/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
sbin_PROGRAMS += zinject
CPPCHECKTARGETS += zinject

zinject_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)

zinject_SOURCES = \
%D%/translate.c \
%D%/zinject.c \
Expand Down
2 changes: 1 addition & 1 deletion cmd/zpool/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
zpool_CFLAGS = $(AM_CFLAGS)
zpool_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)

zpool_CPPFLAGS = $(AM_CPPFLAGS)
zpool_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
zpool_CPPFLAGS += -I$(srcdir)/%D%

sbin_PROGRAMS += zpool
Expand Down
1 change: 1 addition & 0 deletions cmd/ztest.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@
#include <sys/crypto/icp.h>
#include <sys/zfs_impl.h>
#include <sys/backtrace.h>
#include <libzpool.h>

static int ztest_fd_data = -1;
static int ztest_fd_rand = -1;
Expand Down
7 changes: 4 additions & 3 deletions config/Rules.am
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ AM_CPPFLAGS = \
-include $(top_builddir)/zfs_config.h \
-I$(top_builddir)/include \
-I$(top_srcdir)/include \
-I$(top_srcdir)/module/icp/include \
-I$(top_srcdir)/lib/libspl/include \
-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@
-I$(top_srcdir)/lib/libspl/include/os/@ac_system_l@ \
-I$(top_srcdir)/lib/libzpool/include

AM_LIBTOOLFLAGS = --silent

Expand Down Expand Up @@ -73,4 +73,5 @@ LIBRARY_CFLAGS = -no-suppress
# Since ZFS_DEBUG can change shared data structures, all libzpool users must
# be compiled with the same flags.
# See https://github.com/openzfs/zfs/issues/16476
LIBZPOOL_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG
LIBZPOOL_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG
LIBZPOOL_CPPFLAGS += -I$(top_srcdir)/include/os/@ac_system_l@/zfs
2 changes: 2 additions & 0 deletions contrib/pam_zfs_key/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
%C%_pam_zfs_key_la_CFLAGS = $(AM_CFLAGS)
%C%_pam_zfs_key_la_CFLAGS += $(LIBCRYPTO_CFLAGS)

pam_zfs_key_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)

pammodule_LTLIBRARIES = %D%/pam_zfs_key.la

%C%_pam_zfs_key_la_SOURCES = %D%/pam_zfs_key.c
Expand Down
1 change: 1 addition & 0 deletions include/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ USER_H = \
libzfs.h \
libzfs_core.h \
libzfsbootenv.h \
libzpool.h \
libzutil.h \
thread_pool.h

Expand Down
51 changes: 51 additions & 0 deletions include/libzpool.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// 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 <sys/zfs_context.h>

#ifdef __cplusplus
extern "C" {
#endif

extern char *vn_dumpdir;

_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
1 change: 1 addition & 0 deletions include/libzutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ _LIBZUTIL_H void zfs_nicetime(uint64_t, char *, size_t);
_LIBZUTIL_H void zfs_niceraw(uint64_t, char *, size_t);

#define nicenum(num, buf, size) zfs_nicenum(num, buf, size)
#define NN_NUMBUF_SZ (6)

_LIBZUTIL_H void zpool_dump_ddt(const ddt_stat_t *, const ddt_histogram_t *);
_LIBZUTIL_H int zpool_history_unpack(char *, uint64_t, uint64_t *, nvlist_t ***,
Expand Down
4 changes: 2 additions & 2 deletions include/os/freebsd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ noinst_HEADERS = \
%D%/spl/sys/procfs_list.h \
%D%/spl/sys/random.h \
%D%/spl/sys/rwlock.h \
%D%/spl/sys/sdt.h \
%D%/spl/sys/sid.h \
%D%/spl/sys/sig.h \
%D%/spl/sys/simd.h \
Expand All @@ -63,7 +62,6 @@ noinst_HEADERS = \
%D%/spl/sys/time.h \
%D%/spl/sys/timer.h \
%D%/spl/sys/trace.h \
%D%/spl/sys/trace_zfs.h \
%D%/spl/sys/types.h \
%D%/spl/sys/types32.h \
%D%/spl/sys/uio.h \
Expand All @@ -82,10 +80,12 @@ noinst_HEADERS = \
%D%/zfs/sys/arc_os.h \
%D%/zfs/sys/freebsd_crypto.h \
%D%/zfs/sys/freebsd_event.h \
%D%/zfs/sys/trace_zfs.h \
%D%/zfs/sys/vdev_os.h \
%D%/zfs/sys/zfs_bootenv_os.h \
%D%/zfs/sys/zfs_context_os.h \
%D%/zfs/sys/zfs_ctldir.h \
%D%/zfs/sys/zfs_debug_os.h \
%D%/zfs/sys/zfs_dir.h \
%D%/zfs/sys/zfs_ioctl_compat.h \
%D%/zfs/sys/zfs_vfsops_os.h \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@
* $FreeBSD$
*/

#ifndef _OPENSOLARIS_SYS_SDT_H_
#define _OPENSOLARIS_SYS_SDT_H_
#ifndef _SYS_ZFS_DEBUG_OS_H
#define _SYS_ZFS_DEBUG_OS_H

#include <sys/sdt.h>

#include_next <sys/sdt.h>
#ifdef KDTRACE_HOOKS
SDT_PROBE_DECLARE(sdt, , , set__error);

Expand All @@ -44,4 +45,4 @@ SDT_PROBE_DECLARE(sdt, , , set__error);
#define SET_ERROR(err) (err)
#endif

#endif /* _OPENSOLARIS_SYS_SDT_H_ */
#endif /* _SYS_ZFS_DEBUG_OS_H */
2 changes: 1 addition & 1 deletion include/os/linux/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ kernel_sys_HEADERS = \
%D%/zfs/sys/zfs_bootenv_os.h \
%D%/zfs/sys/zfs_context_os.h \
%D%/zfs/sys/zfs_ctldir.h \
%D%/zfs/sys/zfs_debug_os.h \
%D%/zfs/sys/zfs_dir.h \
%D%/zfs/sys/zfs_vfsops_os.h \
%D%/zfs/sys/zfs_vnops_os.h \
Expand Down Expand Up @@ -97,7 +98,6 @@ kernel_spl_sys_HEADERS = \
%D%/spl/sys/time.h \
%D%/spl/sys/timer.h \
%D%/spl/sys/trace.h \
%D%/spl/sys/trace_spl.h \
%D%/spl/sys/trace_taskq.h \
%D%/spl/sys/tsd.h \
%D%/spl/sys/types.h \
Expand Down
8 changes: 0 additions & 8 deletions include/os/linux/spl/sys/sysmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@
#include <sys/signal.h>
#include <asm/page.h>


#ifndef _KERNEL
#define _KERNEL __KERNEL__
#endif

#define FALSE 0
#define TRUE 1

Expand Down Expand Up @@ -202,9 +197,6 @@ makedev(unsigned int major, unsigned int minor)
#define P2SAMEHIGHBIT_TYPED(x, y, type) \
(((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))

#define SET_ERROR(err) \
(__set_error(__FILE__, __func__, __LINE__, err), err)

#include <linux/sort.h>
#define qsort(base, num, size, cmp) \
sort(base, num, size, cmp, NULL)
Expand Down
29 changes: 29 additions & 0 deletions include/os/linux/zfs/sys/zfs_debug_os.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 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
*/

#ifndef _SYS_ZFS_DEBUG_OS_H
#define _SYS_ZFS_DEBUG_OS_H

#define SET_ERROR(err) \
(__set_error(__FILE__, __func__, __LINE__, err), err)

#endif /* _SYS_ZFS_DEBUG_OS_H */
2 changes: 2 additions & 0 deletions include/sys/crypto/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extern "C" {
#endif

#include <sys/zfs_context.h>
#include <sys/types.h>
#include <sys/uio.h>

/* Cryptographic Mechanisms */

Expand Down
2 changes: 1 addition & 1 deletion include/sys/zfs_acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
#ifdef _KERNEL
#include <sys/isa_defs.h>
#include <sys/types32.h>
#include <sys/xvattr.h>
#endif
#include <sys/xvattr.h>
#include <sys/acl.h>
#include <sys/dmu.h>
#include <sys/zfs_fuid.h>
Expand Down
Loading
Loading