From 60356b1a211a0fcfe7dbd2e1dd280d6fc0170cf0 Mon Sep 17 00:00:00 2001 From: Arvind Sankar Date: Thu, 11 Jun 2020 16:25:39 -0400 Subject: [PATCH] Add include files for prototypes Include the header with prototypes in the file that provides definitions as well, to catch any mismatch between prototype and definition. Reviewed-by: Ryan Moeller Reviewed-by: Brian Behlendorf Signed-off-by: Arvind Sankar Closes #10470 --- cmd/zed/zed_event.c | 1 + cmd/zed/zed_exec.c | 1 + cmd/zed/zed_exec.h | 1 + cmd/zed/zed_file.c | 1 + lib/libshare/nfs.c | 1 + lib/libspl/os/freebsd/getexecname.c | 15 ++++++++------- lib/libspl/os/linux/getexecname.c | 5 +++-- lib/libzfs/os/freebsd/libzfs_zmount.c | 2 ++ module/icp/io/edonr_mod.c | 1 + module/icp/io/sha1_mod.c | 1 + module/icp/io/skein_mod.c | 1 + module/os/freebsd/spl/spl_vm.c | 1 + module/os/linux/spl/spl-generic.c | 1 + module/zcommon/zfs_prop.c | 1 + module/zcommon/zpool_prop.c | 1 + module/zfs/blkptr.c | 1 + module/zfs/dmu_object.c | 1 + module/zfs/edonr_zfs.c | 2 +- module/zfs/gzip.c | 1 + module/zfs/lz4.c | 1 + module/zfs/lzjb.c | 1 + module/zfs/sha256.c | 1 + module/zfs/skein_zfs.c | 1 + module/zfs/spa_boot.c | 2 +- module/zfs/zcp_get.c | 1 + module/zfs/zle.c | 1 + 26 files changed, 36 insertions(+), 11 deletions(-) diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c index 2a7ff16fd3..197c253868 100644 --- a/cmd/zed/zed_event.c +++ b/cmd/zed/zed_event.c @@ -28,6 +28,7 @@ #include "zed.h" #include "zed_conf.h" #include "zed_disk_event.h" +#include "zed_event.h" #include "zed_exec.h" #include "zed_file.h" #include "zed_log.h" diff --git a/cmd/zed/zed_exec.c b/cmd/zed/zed_exec.c index 037037168d..08b7b55683 100644 --- a/cmd/zed/zed_exec.c +++ b/cmd/zed/zed_exec.c @@ -22,6 +22,7 @@ #include #include #include +#include "zed_exec.h" #include "zed_file.h" #include "zed_log.h" #include "zed_strings.h" diff --git a/cmd/zed/zed_exec.h b/cmd/zed/zed_exec.h index 69179c92c5..4153e5519a 100644 --- a/cmd/zed/zed_exec.h +++ b/cmd/zed/zed_exec.h @@ -16,6 +16,7 @@ #define ZED_EXEC_H #include +#include "zed_strings.h" int zed_exec_process(uint64_t eid, const char *class, const char *subclass, const char *dir, zed_strings_t *zedlets, zed_strings_t *envs, diff --git a/cmd/zed/zed_file.c b/cmd/zed/zed_file.c index 3a1a661faa..c3cf3d421c 100644 --- a/cmd/zed/zed_file.c +++ b/cmd/zed/zed_file.c @@ -20,6 +20,7 @@ #include #include #include +#include "zed_file.h" #include "zed_log.h" /* diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c index 7cc5ae43f5..c45f25cd05 100644 --- a/lib/libshare/nfs.c +++ b/lib/libshare/nfs.c @@ -35,6 +35,7 @@ #include #include #include "libshare_impl.h" +#include "nfs.h" static boolean_t nfs_available(void); diff --git a/lib/libspl/os/freebsd/getexecname.c b/lib/libspl/os/freebsd/getexecname.c index 13e50d3240..2b057cc730 100644 --- a/lib/libspl/os/freebsd/getexecname.c +++ b/lib/libspl/os/freebsd/getexecname.c @@ -21,14 +21,15 @@ */ -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include const char * getexecname(void) diff --git a/lib/libspl/os/linux/getexecname.c b/lib/libspl/os/linux/getexecname.c index c21a110ad5..6352a1a340 100644 --- a/lib/libspl/os/linux/getexecname.c +++ b/lib/libspl/os/linux/getexecname.c @@ -25,10 +25,11 @@ */ +#include +#include +#include #include #include -#include -#include const char * getexecname(void) diff --git a/lib/libzfs/os/freebsd/libzfs_zmount.c b/lib/libzfs/os/freebsd/libzfs_zmount.c index c6415b8b80..2207fffc55 100644 --- a/lib/libzfs/os/freebsd/libzfs_zmount.c +++ b/lib/libzfs/os/freebsd/libzfs_zmount.c @@ -43,6 +43,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "libzfs_impl.h" + static void build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len) diff --git a/module/icp/io/edonr_mod.c b/module/icp/io/edonr_mod.c index 544814a984..a806af6106 100644 --- a/module/icp/io/edonr_mod.c +++ b/module/icp/io/edonr_mod.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/module/icp/io/sha1_mod.c b/module/icp/io/sha1_mod.c index d0b23cb786..ffae143cde 100644 --- a/module/icp/io/sha1_mod.c +++ b/module/icp/io/sha1_mod.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include diff --git a/module/icp/io/skein_mod.c b/module/icp/io/skein_mod.c index 621fa61581..18026807fd 100644 --- a/module/icp/io/skein_mod.c +++ b/module/icp/io/skein_mod.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #define SKEIN_MODULE_IMPL diff --git a/module/os/freebsd/spl/spl_vm.c b/module/os/freebsd/spl/spl_vm.c index cd18ebb7ad..9f7acab745 100644 --- a/module/os/freebsd/spl/spl_vm.c +++ b/module/os/freebsd/spl/spl_vm.c @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include diff --git a/module/os/linux/spl/spl-generic.c b/module/os/linux/spl/spl-generic.c index 8374472390..aa74f6042e 100644 --- a/module/os/linux/spl/spl-generic.c +++ b/module/os/linux/spl/spl-generic.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include diff --git a/module/zcommon/zfs_prop.c b/module/zcommon/zfs_prop.c index d62eec3f02..3a005b687b 100644 --- a/module/zcommon/zfs_prop.c +++ b/module/zcommon/zfs_prop.c @@ -857,6 +857,7 @@ zfs_prop_valid_keylocation(const char *str, boolean_t encrypted) #ifndef _KERNEL +#include /* * Returns a string describing the set of acceptable values for the given diff --git a/module/zcommon/zpool_prop.c b/module/zcommon/zpool_prop.c index 155d557f46..3cfb435e42 100644 --- a/module/zcommon/zpool_prop.c +++ b/module/zcommon/zpool_prop.c @@ -235,6 +235,7 @@ zpool_prop_random_value(zpool_prop_t prop, uint64_t seed) } #ifndef _KERNEL +#include const char * zpool_prop_values(zpool_prop_t prop) diff --git a/module/zfs/blkptr.c b/module/zfs/blkptr.c index ee24b1c312..73600e4ab6 100644 --- a/module/zfs/blkptr.c +++ b/module/zfs/blkptr.c @@ -17,6 +17,7 @@ * Copyright (c) 2013, 2016 by Delphix. All rights reserved. */ +#include #include #include #include diff --git a/module/zfs/dmu_object.c b/module/zfs/dmu_object.c index be4eba91c3..453a2842ce 100644 --- a/module/zfs/dmu_object.c +++ b/module/zfs/dmu_object.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/module/zfs/edonr_zfs.c b/module/zfs/edonr_zfs.c index e92da6d6c1..aa00e1c941 100644 --- a/module/zfs/edonr_zfs.c +++ b/module/zfs/edonr_zfs.c @@ -27,8 +27,8 @@ */ #include #include +#include #include -#include /* For CTASSERT() */ #include #define EDONR_MODE 512 diff --git a/module/zfs/gzip.c b/module/zfs/gzip.c index 9d8af3228f..e2c6e59969 100644 --- a/module/zfs/gzip.c +++ b/module/zfs/gzip.c @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef _KERNEL diff --git a/module/zfs/lz4.c b/module/zfs/lz4.c index 953c440dfe..52e527b02a 100644 --- a/module/zfs/lz4.c +++ b/module/zfs/lz4.c @@ -33,6 +33,7 @@ */ #include +#include static int real_LZ4_compress(const char *source, char *dest, int isize, int osize); diff --git a/module/zfs/lzjb.c b/module/zfs/lzjb.c index ae18467011..a478e64c51 100644 --- a/module/zfs/lzjb.c +++ b/module/zfs/lzjb.c @@ -37,6 +37,7 @@ */ #include +#include #define MATCH_BITS 6 #define MATCH_MIN 3 diff --git a/module/zfs/sha256.c b/module/zfs/sha256.c index 406c926a07..d297768ead 100644 --- a/module/zfs/sha256.c +++ b/module/zfs/sha256.c @@ -28,6 +28,7 @@ */ #include #include +#include #include #include #include diff --git a/module/zfs/skein_zfs.c b/module/zfs/skein_zfs.c index 8deb84b266..11b9940e02 100644 --- a/module/zfs/skein_zfs.c +++ b/module/zfs/skein_zfs.c @@ -24,6 +24,7 @@ */ #include #include +#include #include #include diff --git a/module/zfs/spa_boot.c b/module/zfs/spa_boot.c index be79542c90..674394650f 100644 --- a/module/zfs/spa_boot.c +++ b/module/zfs/spa_boot.c @@ -27,7 +27,7 @@ #ifdef _KERNEL #include -#include +#include #include char * diff --git a/module/zfs/zcp_get.c b/module/zfs/zcp_get.c index a23230ffbd..7256e4de19 100644 --- a/module/zfs/zcp_get.c +++ b/module/zfs/zcp_get.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/module/zfs/zle.c b/module/zfs/zle.c index 613607faaa..0decebb13c 100644 --- a/module/zfs/zle.c +++ b/module/zfs/zle.c @@ -32,6 +32,7 @@ */ #include #include +#include size_t zle_compress(void *s_start, void *d_start, size_t s_len, size_t d_len, int n)