From 913bdbf4d191b4b9681f145da8f3d641c191cd02 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 30 Oct 2025 17:49:18 -0700 Subject: [PATCH] libzpool: remove global libzpool includes Only include the zfs headers where they're currently required to compile. Unfortunately, including zfs_ioctl.h in user space pulls in a bunch of internal zfs headers as a side effect. We'll need to move these structures in to a new shared header to avoid this. We should not need to add the LIBZPOOL_CPPFLAGS when building the zed, zinject, zpool, libzfs, ior libzfs_core. Sponsored-by: https://despairlabs.com/sponsor/ Signed-off-by: Brian Behlendorf Signed-off-by: Rob Norris Closes #17861 --- lib/libspl/taskq.c | 7 ++++++- lib/libzfs/libzfs_crypto.c | 1 - lib/libzpool/Makefile.am | 1 - tests/zfs-tests/cmd/Makefile.am | 1 - tests/zfs-tests/cmd/ereports.c | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/libspl/taskq.c b/lib/libspl/taskq.c index 0457de21f..075d18893 100644 --- a/lib/libspl/taskq.c +++ b/lib/libspl/taskq.c @@ -29,7 +29,12 @@ * Copyright (c) 2014 by Delphix. All rights reserved. */ -#include +#include +#include +#include +#include +#include +#include int taskq_now; taskq_t *system_taskq; diff --git a/lib/libzfs/libzfs_crypto.c b/lib/libzfs/libzfs_crypto.c index f7cc1e84f..f461ad414 100644 --- a/lib/libzfs/libzfs_crypto.c +++ b/lib/libzfs/libzfs_crypto.c @@ -19,7 +19,6 @@ * Copyright 2020 Joyent, Inc. */ -#include #include #include #include diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 2156385bf..f4a78b666 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -4,7 +4,6 @@ libzpool_la_CFLAGS = $(AM_CFLAGS) $(KERNEL_CFLAGS) $(LIBRARY_CFLAGS) libzpool_la_CFLAGS += $(ZLIB_CFLAGS) libzpool_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS) -libzpool_la_CPPFLAGS += -I$(srcdir)/include/os/@ac_system_l@/zfs libzpool_la_CPPFLAGS += -DLIB_ZPOOL_BUILD lib_LTLIBRARIES += libzpool.la diff --git a/tests/zfs-tests/cmd/Makefile.am b/tests/zfs-tests/cmd/Makefile.am index 85c3cf3c3..8d645248f 100644 --- a/tests/zfs-tests/cmd/Makefile.am +++ b/tests/zfs-tests/cmd/Makefile.am @@ -60,7 +60,6 @@ scripts_zfs_tests_bin_PROGRAMS += %D%/file_append %D%/file_check %D%/file_trunc scripts_zfs_tests_bin_PROGRAMS += %D%/libzfs_input_check -%C%_libzfs_input_check_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/include/os/@ac_system_l@/zfs %C%_libzfs_input_check_LDADD = \ libzfs_core.la \ libnvpair.la diff --git a/tests/zfs-tests/cmd/ereports.c b/tests/zfs-tests/cmd/ereports.c index f981d5b34..a28495b76 100644 --- a/tests/zfs-tests/cmd/ereports.c +++ b/tests/zfs-tests/cmd/ereports.c @@ -22,11 +22,12 @@ #include #include #include -#include #include #include #include +#define ZEVENT_NONBLOCK 0x1 + /* * Command to output io and checksum ereport values, one per line. * Used by zpool_events_duplicates.ksh to check for duplicate events.