Skip to content

Commit da82cc6

Browse files
behlendorfrobn
authored andcommitted
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. Signed-off-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]>
1 parent 9bfa339 commit da82cc6

File tree

14 files changed

+26
-9
lines changed

14 files changed

+26
-9
lines changed

cmd/zed/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ include $(srcdir)/%D%/zed.d/Makefile.am
33
zed_CFLAGS = $(AM_CFLAGS)
44
zed_CFLAGS += $(LIBUDEV_CFLAGS) $(LIBUUID_CFLAGS)
55

6+
zed_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
7+
68
sbin_PROGRAMS += zed
79
CPPCHECKTARGETS += zed
810

cmd/zinject/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
sbin_PROGRAMS += zinject
22
CPPCHECKTARGETS += zinject
33

4+
zinject_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
5+
46
zinject_SOURCES = \
57
%D%/translate.c \
68
%D%/zinject.c \

cmd/zpool/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
zpool_CFLAGS = $(AM_CFLAGS)
22
zpool_CFLAGS += $(LIBBLKID_CFLAGS) $(LIBUUID_CFLAGS)
33

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

77
sbin_PROGRAMS += zpool

config/Rules.am

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,5 @@ LIBRARY_CFLAGS = -no-suppress
7474
# Since ZFS_DEBUG can change shared data structures, all libzpool users must
7575
# be compiled with the same flags.
7676
# See https://github.com/openzfs/zfs/issues/16476
77-
LIBZPOOL_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG
77+
LIBZPOOL_CPPFLAGS = -DDEBUG -UNDEBUG -DZFS_DEBUG
78+
LIBZPOOL_CPPFLAGS += -I$(top_srcdir)/include/os/@ac_system_l@/zfs

contrib/pam_zfs_key/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
%C%_pam_zfs_key_la_CFLAGS = $(AM_CFLAGS)
22
%C%_pam_zfs_key_la_CFLAGS += $(LIBCRYPTO_CFLAGS)
33

4+
pam_zfs_key_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
5+
46
pammodule_LTLIBRARIES = %D%/pam_zfs_key.la
57

68
%C%_pam_zfs_key_la_SOURCES = %D%/pam_zfs_key.c

lib/libspl/taskq.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,12 @@
2929
* Copyright (c) 2014 by Delphix. All rights reserved.
3030
*/
3131

32-
#include <sys/zfs_context.h>
32+
#include <sys/sysmacros.h>
33+
#include <sys/timer.h>
34+
#include <sys/types.h>
35+
#include <sys/thread.h>
36+
#include <sys/taskq.h>
37+
#include <sys/kmem.h>
3338

3439
int taskq_now;
3540
taskq_t *system_taskq;

lib/libzdb/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
libzdb_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
22
libzdb_la_CFLAGS += -fvisibility=hidden
33

4+
libzdb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
5+
46
noinst_LTLIBRARIES += libzdb.la
57

68
libzdb_la_SOURCES = \

lib/libzfs/Makefile.am

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ libzfs_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
22
libzfs_la_CFLAGS += $(LIBCRYPTO_CFLAGS) $(ZLIB_CFLAGS)
33
libzfs_la_CFLAGS += -fvisibility=hidden
44

5+
libzfs_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
6+
57
lib_LTLIBRARIES += libzfs.la
68
CPPCHECKTARGETS += libzfs.la
79

lib/libzfs/libzfs_crypto.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* Copyright 2020 Joyent, Inc.
2020
*/
2121

22-
#include <sys/zfs_context.h>
2322
#include <sys/fs/zfs.h>
2423
#include <sys/dsl_crypt.h>
2524
#include <libintl.h>

lib/libzfs_core/Makefile.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
libzfs_core_la_CFLAGS = $(AM_CFLAGS) $(LIBRARY_CFLAGS)
22
libzfs_core_la_CFLAGS += -fvisibility=hidden
33

4-
libzfs_core_la_CPPFLAGS = $(AM_CPPFLAGS)
4+
libzfs_core_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBZPOOL_CPPFLAGS)
55
libzfs_core_la_CPPFLAGS += -I$(srcdir)/%D%
66

77
lib_LTLIBRARIES += libzfs_core.la

0 commit comments

Comments
 (0)