From 870c15aa85c4f2fe88d0a2c6af730037e5110487 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 | 11 ++++++----- 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, 34 insertions(+), 9 deletions(-) diff --git a/cmd/zed/zed_event.c b/cmd/zed/zed_event.c index 2a7ff16fd38e..197c25386852 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 037037168d18..08b7b5568362 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 69179c92c53a..4153e5519a46 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 3a1a661faa46..c3cf3d421c6f 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 7cc5ae43f500..c45f25cd0532 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 13e50d32404d..2b057cc73016 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 const char * getexecname(void) diff --git a/lib/libspl/os/linux/getexecname.c b/lib/libspl/os/linux/getexecname.c index c21a110ad566..6352a1a34015 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 c6415b8b80eb..2207fffc5573 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 544814a98479..a806af610629 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 d0b23cb78611..ffae143cded0 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 621fa615818f..18026807fd84 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 cd18ebb7adfc..9f7acab74564 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 83744723908f..aa74f6042e04 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 d62eec3f0236..3a005b687bbf 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 155d557f464a..3cfb435e4237 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 ee24b1c312da..73600e4ab643 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 be4eba91c359..453a2842ce6e 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 e92da6d6c1d4..aa00e1c9417e 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 9d8af3228f9a..e2c6e59969d6 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 953c440dfeea..52e527b02acd 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 ae18467011cb..a478e64c5141 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 406c926a07e5..d297768eada5 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 8deb84b266bd..11b9940e027e 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 be79542c9049..674394650f82 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 a23230ffbd61..7256e4de1915 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 613607faaa97..0decebb13ca7 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)