From 3d2d14bcb844e72809192311369a642c5d415472 Mon Sep 17 00:00:00 2001 From: Sitsofe Wheeler Date: Mon, 19 Mar 2018 05:33:13 +0000 Subject: [PATCH] Refactor #includes and headers - Try and remove unneeded #include lines - Try and add #include lines that would allow the files to be built in a more standalone manner Signed-off-by: Sitsofe Wheeler --- backend.c | 12 ------------ blktrace.c | 2 -- cconv.c | 1 + cgroup.c | 1 - client.c | 4 +--- client.h | 6 ++---- compiler/compiler.h | 1 - crc/crc32.c | 1 - crc/crc32.h | 2 ++ crc/crc32c-intel.c | 7 ------- crc/crc32c.c | 2 -- crc/crc32c.h | 2 ++ crc/md5.c | 1 - crc/sha1.h | 2 ++ crc/sha256.c | 1 - crc/sha256.h | 2 ++ crc/sha3.c | 1 - crc/sha512.c | 1 - crc/sha512.h | 2 ++ crc/test.c | 5 +++-- debug.c | 5 +++-- debug.h | 2 -- diskutil.c | 3 --- diskutil.h | 1 - engines/e4defrag.c | 4 ---- engines/falloc.c | 4 ---- engines/filecreate.c | 2 -- engines/ftruncate.c | 8 +------- engines/libaio.c | 2 -- engines/mmap.c | 1 - engines/mtd.c | 3 --- engines/net.c | 2 -- engines/null.c | 3 --- engines/sg.c | 1 - engines/splice.c | 1 - engines/sync.c | 1 - eta.c | 1 - fifo.c | 1 + fifo.h | 1 - filesetup.c | 2 -- fio.c | 5 ----- fio.h | 1 + fio_sem.c | 2 +- fio_time.h | 1 + gettime-thread.c | 2 -- gettime.c | 7 ------- gettime.h | 2 ++ helpers.c | 9 +-------- helpers.h | 5 ++--- idletime.c | 1 + idletime.h | 5 +++-- init.c | 2 -- io_u.c | 4 ---- io_u.h | 1 - io_u_queue.h | 2 ++ ioengines.c | 1 - ioengines.h | 5 +++-- iolog.c | 2 -- iolog.h | 2 ++ json.c | 1 - json.h | 4 ---- lib/bloom.c | 2 -- lib/gauss.c | 1 - lib/ieee754.c | 1 - lib/lfsr.c | 1 - lib/memalign.c | 3 +-- lib/memalign.h | 2 ++ lib/memcpy.c | 3 ++- lib/num2str.c | 1 + lib/output_buffer.c | 1 - lib/output_buffer.h | 2 +- lib/pattern.c | 2 -- lib/pattern.h | 2 -- lib/prio_tree.c | 1 + lib/prio_tree.h | 1 - lib/rand.c | 1 - lib/rand.h | 1 - lib/strntol.h | 2 ++ lib/zipf.c | 6 ------ lib/zipf.h | 1 + libfio.c | 1 - log.c | 1 - memory.c | 3 +-- options.c | 4 ---- options.h | 1 - oslib/strlcat.h | 2 ++ oslib/strndup.c | 1 + parse.c | 4 +--- server.c | 4 +--- server.h | 3 --- smalloc.c | 8 -------- smalloc.h | 2 ++ stat.c | 3 --- steadystate.c | 1 - steadystate.h | 2 -- t/axmap.c | 3 --- t/btrace2fio.c | 2 +- t/dedupe.c | 10 +++------- t/gen-rand.c | 12 +++--------- t/genzipf.c | 1 - t/lfsr-test.c | 4 ---- td_error.h | 2 ++ trim.c | 3 --- trim.h | 8 ++++++-- verify.h | 1 + workqueue.h | 7 +++++++ 106 files changed, 83 insertions(+), 212 deletions(-) diff --git a/backend.c b/backend.c index d82d4948..a92b1e3c 100644 --- a/backend.c +++ b/backend.c @@ -22,29 +22,17 @@ * */ #include -#include #include -#include #include -#include -#include #include -#include #include #include #include -#include -#include #include #include "fio.h" -#ifndef FIO_NO_HAVE_SHM_H -#include -#endif -#include "hash.h" #include "smalloc.h" #include "verify.h" -#include "trim.h" #include "diskutil.h" #include "cgroup.h" #include "profile.h" diff --git a/blktrace.c b/blktrace.c index 4b791d7e..6e4d0a4c 100644 --- a/blktrace.c +++ b/blktrace.c @@ -3,10 +3,8 @@ */ #include #include -#include #include #include -#include #include "flist.h" #include "fio.h" diff --git a/cconv.c b/cconv.c index 92996b1e..dbe0071a 100644 --- a/cconv.c +++ b/cconv.c @@ -1,5 +1,6 @@ #include +#include "log.h" #include "thread_options.h" static void string_to_cpu(char **dst, const uint8_t *src) diff --git a/cgroup.c b/cgroup.c index 4fab977a..380e37e4 100644 --- a/cgroup.c +++ b/cgroup.c @@ -5,7 +5,6 @@ #include #include #include -#include #include "fio.h" #include "flist.h" #include "cgroup.h" diff --git a/client.c b/client.c index bff0adc0..43825d9e 100644 --- a/client.c +++ b/client.c @@ -1,13 +1,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -23,7 +21,7 @@ #include "server.h" #include "flist.h" #include "hash.h" -#include "verify.h" +#include "verify-state.h" static void handle_du(struct fio_client *client, struct fio_net_cmd *cmd); static void handle_ts(struct fio_client *client, struct fio_net_cmd *cmd); diff --git a/client.h b/client.h index 90082a34..29e84d0d 100644 --- a/client.h +++ b/client.h @@ -1,7 +1,6 @@ #ifndef CLIENT_H #define CLIENT_H -#include #include #include #include @@ -10,7 +9,6 @@ #include "stat.h" struct fio_net_cmd; -struct client_ops; enum { Client_created = 0, @@ -83,6 +81,8 @@ typedef void (client_eta_op)(struct jobs_eta *je); typedef void (client_timed_out_op)(struct fio_client *); typedef void (client_jobs_eta_op)(struct fio_client *client, struct jobs_eta *je); +extern struct client_ops fio_client_ops; + struct client_ops { client_cmd_op *text; client_cmd_op *disk_util; @@ -105,8 +105,6 @@ struct client_ops { uint32_t client_type; }; -extern struct client_ops fio_client_ops; - struct client_eta { unsigned int pending; struct jobs_eta eta; diff --git a/compiler/compiler.h b/compiler/compiler.h index 91a98836..8488aa0d 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -1,6 +1,5 @@ #ifndef FIO_COMPILER_H #define FIO_COMPILER_H -#include #if __GNUC__ >= 4 #include "compiler-gcc4.h" diff --git a/crc/crc32.c b/crc/crc32.c index 4140a8d4..e35f5d93 100644 --- a/crc/crc32.c +++ b/crc/crc32.c @@ -15,7 +15,6 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include #include "crc32.h" static const uint32_t crctab[256] = { diff --git a/crc/crc32.h b/crc/crc32.h index a37d7ada..6378e815 100644 --- a/crc/crc32.h +++ b/crc/crc32.h @@ -18,6 +18,8 @@ #ifndef CRC32_H #define CRC32_H +#include + extern uint32_t fio_crc32(const void * const, unsigned long); #endif diff --git a/crc/crc32c-intel.c b/crc/crc32c-intel.c index 05a087dc..9a2cefde 100644 --- a/crc/crc32c-intel.c +++ b/crc/crc32c-intel.c @@ -1,10 +1,3 @@ -#include -#include -#include -#include -#include -#include -#include #include "crc32c.h" /* diff --git a/crc/crc32c.c b/crc/crc32c.c index f6fc6887..34944aea 100644 --- a/crc/crc32c.c +++ b/crc/crc32c.c @@ -30,8 +30,6 @@ * any later version. * */ -#include - #include "crc32c.h" /* diff --git a/crc/crc32c.h b/crc/crc32c.h index be03c1a2..60f60141 100644 --- a/crc/crc32c.h +++ b/crc/crc32c.h @@ -18,6 +18,8 @@ #ifndef CRC32C_H #define CRC32C_H +#include + #include "../arch/arch.h" #include "../lib/types.h" diff --git a/crc/md5.c b/crc/md5.c index 64fe48a9..ade4f697 100644 --- a/crc/md5.c +++ b/crc/md5.c @@ -2,7 +2,6 @@ * Shamelessly lifted from the 2.6 kernel (crypto/md5.c) */ #include -#include #include "md5.h" static void md5_transform(uint32_t *hash, uint32_t const *in) diff --git a/crc/sha1.h b/crc/sha1.h index 75317f76..416199ba 100644 --- a/crc/sha1.h +++ b/crc/sha1.h @@ -1,6 +1,8 @@ #ifndef FIO_SHA1 #define FIO_SHA1 +#include + /* * Based on the Mozilla SHA1 (see mozilla-sha1/sha1.h), * optimized to do word accesses rather than byte accesses, diff --git a/crc/sha256.c b/crc/sha256.c index 2fd17a32..2b39c42e 100644 --- a/crc/sha256.c +++ b/crc/sha256.c @@ -17,7 +17,6 @@ * */ #include -#include #include "../lib/bswap.h" #include "sha256.h" diff --git a/crc/sha256.h b/crc/sha256.h index b6360336..b904c7d1 100644 --- a/crc/sha256.h +++ b/crc/sha256.h @@ -1,6 +1,8 @@ #ifndef FIO_SHA256_H #define FIO_SHA256_H +#include + #define SHA256_DIGEST_SIZE 32 #define SHA256_BLOCK_SIZE 64 diff --git a/crc/sha3.c b/crc/sha3.c index 2685dce6..c136550a 100644 --- a/crc/sha3.c +++ b/crc/sha3.c @@ -13,7 +13,6 @@ * */ #include -#include #include "../os/os.h" diff --git a/crc/sha512.c b/crc/sha512.c index e069a448..f599cdcc 100644 --- a/crc/sha512.c +++ b/crc/sha512.c @@ -12,7 +12,6 @@ */ #include -#include #include "../lib/bswap.h" #include "sha512.h" diff --git a/crc/sha512.h b/crc/sha512.h index f8b2112a..5adf6271 100644 --- a/crc/sha512.h +++ b/crc/sha512.h @@ -1,6 +1,8 @@ #ifndef FIO_SHA512_H #define FIO_SHA512_H +#include + struct fio_sha512_ctx { uint64_t state[8]; uint32_t count[4]; diff --git a/crc/test.c b/crc/test.c index b1198726..b57f07a4 100644 --- a/crc/test.c +++ b/crc/test.c @@ -1,11 +1,12 @@ +#include #include #include #include -#include "../fio.h" #include "../gettime.h" #include "../fio_time.h" -#include "../verify.h" +#include "../lib/rand.h" +#include "../os/os.h" #include "../crc/md5.h" #include "../crc/crc64.h" diff --git a/debug.c b/debug.c index 2bee5078..d1e2987b 100644 --- a/debug.c +++ b/debug.c @@ -1,7 +1,8 @@ +#include #include -#include -#include + #include "debug.h" +#include "log.h" #ifdef FIO_INC_DEBUG void __dprint(int type, const char *str, ...) diff --git a/debug.h b/debug.h index 1765fdb6..8a8cf871 100644 --- a/debug.h +++ b/debug.h @@ -1,9 +1,7 @@ #ifndef FIO_DEBUG_H #define FIO_DEBUG_H -#include #include "lib/types.h" -#include "log.h" enum { FD_PROCESS = 0, diff --git a/diskutil.c b/diskutil.c index dd8fc6a2..b973120c 100644 --- a/diskutil.c +++ b/diskutil.c @@ -1,13 +1,10 @@ #include #include -#include #include #include #include #include #include -#include -#include #ifdef CONFIG_VALGRIND_DEV #include #else diff --git a/diskutil.h b/diskutil.h index c1035785..15ec681a 100644 --- a/diskutil.h +++ b/diskutil.h @@ -3,7 +3,6 @@ #include "json.h" #define FIO_DU_NAME_SZ 64 -#include "lib/output_buffer.h" #include "helper_thread.h" #include "fio_sem.h" diff --git a/engines/e4defrag.c b/engines/e4defrag.c index 4b444888..3619450d 100644 --- a/engines/e4defrag.c +++ b/engines/e4defrag.c @@ -9,11 +9,7 @@ #include #include #include -#include -#include -#include #include -#include #include #include "../fio.h" diff --git a/engines/falloc.c b/engines/falloc.c index 2b00d525..bb3ac850 100644 --- a/engines/falloc.c +++ b/engines/falloc.c @@ -9,11 +9,7 @@ * */ #include -#include -#include -#include #include -#include #include #include "../fio.h" diff --git a/engines/filecreate.c b/engines/filecreate.c index 0c3bcdd6..6fa041cd 100644 --- a/engines/filecreate.c +++ b/engines/filecreate.c @@ -5,12 +5,10 @@ * of the file creation. */ #include -#include #include #include #include "../fio.h" -#include "../filehash.h" struct fc_data { enum fio_ddir stat_ddir; diff --git a/engines/ftruncate.c b/engines/ftruncate.c index e86dbac0..14e115f2 100644 --- a/engines/ftruncate.c +++ b/engines/ftruncate.c @@ -6,16 +6,10 @@ * DDIR_WRITE does ftruncate * */ -#include -#include -#include -#include #include -#include -#include +#include #include "../fio.h" -#include "../filehash.h" static int fio_ftruncate_queue(struct thread_data *td, struct io_u *io_u) { diff --git a/engines/libaio.c b/engines/libaio.c index e0d7cbba..7d59df38 100644 --- a/engines/libaio.c +++ b/engines/libaio.c @@ -4,11 +4,9 @@ * IO engine using the Linux native aio interface. * */ -#include #include #include #include -#include #include #include "../fio.h" diff --git a/engines/mmap.c b/engines/mmap.c index ea7179da..9dbefc82 100644 --- a/engines/mmap.c +++ b/engines/mmap.c @@ -7,7 +7,6 @@ */ #include #include -#include #include #include diff --git a/engines/mtd.c b/engines/mtd.c index b4a66004..5f822fc1 100644 --- a/engines/mtd.c +++ b/engines/mtd.c @@ -4,17 +4,14 @@ * IO engine that reads/writes from MTD character devices. * */ -#include #include #include -#include #include #include #include #include "../fio.h" #include "../optgroup.h" -#include "../verify.h" #include "../oslib/libmtd.h" static libmtd_t desc; diff --git a/engines/net.c b/engines/net.c index 37d44fd8..9b385b0c 100644 --- a/engines/net.c +++ b/engines/net.c @@ -9,13 +9,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include #include diff --git a/engines/null.c b/engines/null.c index 0cfc22ad..8c26ad71 100644 --- a/engines/null.c +++ b/engines/null.c @@ -13,10 +13,7 @@ * LD_LIBRARY_PATH=./engines ./fio examples/cpp_null.fio * */ -#include #include -#include -#include #include #include "../fio.h" diff --git a/engines/sg.c b/engines/sg.c index f2407555..7b18c28e 100644 --- a/engines/sg.c +++ b/engines/sg.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #include "../fio.h" diff --git a/engines/splice.c b/engines/splice.c index d5d8ab0e..d322f402 100644 --- a/engines/splice.c +++ b/engines/splice.c @@ -9,7 +9,6 @@ #include #include #include -#include #include #include diff --git a/engines/sync.c b/engines/sync.c index 26b98b60..d5b4012f 100644 --- a/engines/sync.c +++ b/engines/sync.c @@ -10,7 +10,6 @@ #include #include #include -#include #include "../fio.h" #include "../optgroup.h" diff --git a/eta.c b/eta.c index 3126f217..2d549ee9 100644 --- a/eta.c +++ b/eta.c @@ -2,7 +2,6 @@ * Status and ETA code */ #include -#include #include #ifdef CONFIG_VALGRIND_DEV #include diff --git a/fifo.c b/fifo.c index 98737e9c..ac0d2157 100644 --- a/fifo.c +++ b/fifo.c @@ -24,6 +24,7 @@ #include #include "fifo.h" +#include "minmax.h" struct fifo *fifo_alloc(unsigned int size) { diff --git a/fifo.h b/fifo.h index 5e3d3396..61cc5a87 100644 --- a/fifo.h +++ b/fifo.h @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ -#include "minmax.h" struct fifo { unsigned char *buffer; /* the buffer holding the data */ diff --git a/filesetup.c b/filesetup.c index 7cbce132..c115f7b1 100644 --- a/filesetup.c +++ b/filesetup.c @@ -5,8 +5,6 @@ #include #include #include -#include -#include #include "fio.h" #include "smalloc.h" diff --git a/fio.c b/fio.c index 7b61ffca..f19db1be 100644 --- a/fio.c +++ b/fio.c @@ -21,12 +21,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * */ -#include -#include -#include - #include "fio.h" -#include "smalloc.h" int main(int argc, char *argv[], char *envp[]) { diff --git a/fio.h b/fio.h index 95510487..488fa9a6 100644 --- a/fio.h +++ b/fio.h @@ -27,6 +27,7 @@ #include "ioengines.h" #include "iolog.h" #include "helpers.h" +#include "minmax.h" #include "options.h" #include "profile.h" #include "fio_time.h" diff --git a/fio_sem.c b/fio_sem.c index 20fcfccc..3b48061c 100644 --- a/fio_sem.c +++ b/fio_sem.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -7,7 +8,6 @@ #define RUNNING_ON_VALGRIND 0 #endif -#include "log.h" #include "fio_sem.h" #include "pshared.h" #include "os/os.h" diff --git a/fio_time.h b/fio_time.h index 8b4bb255..39fb17ba 100644 --- a/fio_time.h +++ b/fio_time.h @@ -1,6 +1,7 @@ #ifndef FIO_TIME_H #define FIO_TIME_H +#include #include #include #include "lib/types.h" diff --git a/gettime-thread.c b/gettime-thread.c index 87f50600..eb535a07 100644 --- a/gettime-thread.c +++ b/gettime-thread.c @@ -1,5 +1,3 @@ -#include -#include #include #include diff --git a/gettime.c b/gettime.c index 57c66f7e..87fc29b5 100644 --- a/gettime.c +++ b/gettime.c @@ -2,16 +2,9 @@ * Clock functions */ -#include #include -#include -#include #include "fio.h" -#include "fio_sem.h" -#include "smalloc.h" - -#include "hash.h" #include "os/os.h" #if defined(ARCH_HAVE_CPU_CLOCK) diff --git a/gettime.h b/gettime.h index 11e2a7b9..1c4a25c8 100644 --- a/gettime.h +++ b/gettime.h @@ -1,6 +1,8 @@ #ifndef FIO_GETTIME_H #define FIO_GETTIME_H +#include + #include "arch/arch.h" /* diff --git a/helpers.c b/helpers.c index 4342b2d2..a0ee3704 100644 --- a/helpers.c +++ b/helpers.c @@ -1,13 +1,6 @@ -#include #include -#include -#include -#include -#include -#include "compiler/compiler.h" -#include "arch/arch.h" -#include "os/os.h" +#include "helpers.h" #ifndef CONFIG_LINUX_FALLOCATE int fallocate(int fd, int mode, off_t offset, off_t len) diff --git a/helpers.h b/helpers.h index 5f1865bb..a0b32858 100644 --- a/helpers.h +++ b/helpers.h @@ -1,10 +1,9 @@ #ifndef FIO_HELPERS_H #define FIO_HELPERS_H -#include "compiler/compiler.h" - #include -#include + +#include "os/os.h" extern int fallocate(int fd, int mode, off_t offset, off_t len); extern int posix_fallocate(int fd, off_t offset, off_t len); diff --git a/idletime.c b/idletime.c index 90bc1d9e..8762c856 100644 --- a/idletime.c +++ b/idletime.c @@ -1,4 +1,5 @@ #include +#include "fio.h" #include "json.h" #include "idletime.h" diff --git a/idletime.h b/idletime.h index b8376c2c..6c1161a7 100644 --- a/idletime.h +++ b/idletime.h @@ -1,8 +1,9 @@ #ifndef FIO_IDLETIME_H #define FIO_IDLETIME_H -#include "fio.h" -#include "lib/output_buffer.h" +#include +#include +#include "os/os.h" #define CALIBRATE_RUNS 10 #define CALIBRATE_SCALE 1000 diff --git a/init.c b/init.c index e47e5384..ab7e3997 100644 --- a/init.c +++ b/init.c @@ -4,13 +4,11 @@ #include #include #include -#include #include #include #include #include #include -#include #include #ifdef CONFIG_VALGRIND_DEV #include diff --git a/io_u.c b/io_u.c index f3b59322..98a7dc56 100644 --- a/io_u.c +++ b/io_u.c @@ -1,12 +1,8 @@ #include -#include #include -#include -#include #include #include "fio.h" -#include "hash.h" #include "verify.h" #include "trim.h" #include "lib/rand.h" diff --git a/io_u.h b/io_u.h index da25efb9..aaa7d972 100644 --- a/io_u.h +++ b/io_u.h @@ -3,7 +3,6 @@ #include "compiler/compiler.h" #include "os/os.h" -#include "log.h" #include "io_ddir.h" #include "debug.h" #include "file.h" diff --git a/io_u_queue.h b/io_u_queue.h index b5b8d2fa..545e2c41 100644 --- a/io_u_queue.h +++ b/io_u_queue.h @@ -2,6 +2,8 @@ #define FIO_IO_U_QUEUE #include +#include + #include "lib/types.h" struct io_u; diff --git a/ioengines.c b/ioengines.c index 965581aa..a8ec79de 100644 --- a/ioengines.c +++ b/ioengines.c @@ -9,7 +9,6 @@ * generic io engine that could be used for other projects. * */ -#include #include #include #include diff --git a/ioengines.h b/ioengines.h index 32b18eda..a0674aea 100644 --- a/ioengines.h +++ b/ioengines.h @@ -1,9 +1,10 @@ #ifndef FIO_IOENGINE_H #define FIO_IOENGINE_H +#include + #include "compiler/compiler.h" -#include "os/os.h" -#include "file.h" +#include "flist.h" #include "io_u.h" #define FIO_IOOPS_VERSION 23 diff --git a/iolog.c b/iolog.c index 460d7a2e..2b5eaf0c 100644 --- a/iolog.c +++ b/iolog.c @@ -4,7 +4,6 @@ */ #include #include -#include #include #include #include @@ -15,7 +14,6 @@ #include "flist.h" #include "fio.h" -#include "verify.h" #include "trim.h" #include "filelock.h" #include "smalloc.h" diff --git a/iolog.h b/iolog.h index 70981f99..f70eb61e 100644 --- a/iolog.h +++ b/iolog.h @@ -1,6 +1,8 @@ #ifndef FIO_IOLOG_H #define FIO_IOLOG_H +#include + #include "lib/rbtree.h" #include "lib/ieee754.h" #include "flist.h" diff --git a/json.c b/json.c index e0227ec6..75212c85 100644 --- a/json.c +++ b/json.c @@ -1,6 +1,5 @@ #include #include -#include #include #include #include "json.h" diff --git a/json.h b/json.h index d7017e06..bcc712cd 100644 --- a/json.h +++ b/json.h @@ -3,10 +3,6 @@ #include "lib/output_buffer.h" -struct json_object; -struct json_array; -struct json_pair; - #define JSON_TYPE_STRING 0 #define JSON_TYPE_INTEGER 1 #define JSON_TYPE_FLOAT 2 diff --git a/lib/bloom.c b/lib/bloom.c index bb81dbbd..f4f9b6b9 100644 --- a/lib/bloom.c +++ b/lib/bloom.c @@ -1,9 +1,7 @@ #include -#include #include "bloom.h" #include "../hash.h" -#include "../minmax.h" #include "../crc/xxhash.h" #include "../crc/murmur3.h" #include "../crc/crc32c.h" diff --git a/lib/gauss.c b/lib/gauss.c index f974490f..1d24e187 100644 --- a/lib/gauss.c +++ b/lib/gauss.c @@ -1,6 +1,5 @@ #include #include -#include #include "../hash.h" #include "gauss.h" diff --git a/lib/ieee754.c b/lib/ieee754.c index c7742a2d..2154065c 100644 --- a/lib/ieee754.c +++ b/lib/ieee754.c @@ -5,7 +5,6 @@ * * Below code was granted to the public domain. */ -#include #include "ieee754.h" uint64_t pack754(long double f, unsigned bits, unsigned expbits) diff --git a/lib/lfsr.c b/lib/lfsr.c index 0c0072cc..a4f1fb13 100644 --- a/lib/lfsr.c +++ b/lib/lfsr.c @@ -1,5 +1,4 @@ #include -#include #include "lfsr.h" #include "../compiler/compiler.h" diff --git a/lib/memalign.c b/lib/memalign.c index bfbd1e80..e774c19c 100644 --- a/lib/memalign.c +++ b/lib/memalign.c @@ -1,6 +1,5 @@ -#include #include -#include +#include #include "memalign.h" diff --git a/lib/memalign.h b/lib/memalign.h index df412e28..c2eb1702 100644 --- a/lib/memalign.h +++ b/lib/memalign.h @@ -1,6 +1,8 @@ #ifndef FIO_MEMALIGN_H #define FIO_MEMALIGN_H +#include + extern void *fio_memalign(size_t alignment, size_t size); extern void fio_memfree(void *ptr, size_t size); diff --git a/lib/memcpy.c b/lib/memcpy.c index 00e65aa7..cf8572e2 100644 --- a/lib/memcpy.c +++ b/lib/memcpy.c @@ -1,3 +1,4 @@ +#include #include #include #include @@ -6,7 +7,7 @@ #include "rand.h" #include "../fio_time.h" #include "../gettime.h" -#include "../fio.h" +#include "../os/os.h" #define BUF_SIZE 32 * 1024 * 1024ULL diff --git a/lib/num2str.c b/lib/num2str.c index 8d088413..387c5d7b 100644 --- a/lib/num2str.c +++ b/lib/num2str.c @@ -1,3 +1,4 @@ +#include #include #include #include diff --git a/lib/output_buffer.c b/lib/output_buffer.c index f6c304bd..beb8a142 100644 --- a/lib/output_buffer.c +++ b/lib/output_buffer.c @@ -1,4 +1,3 @@ -#include #include #include diff --git a/lib/output_buffer.h b/lib/output_buffer.h index a235af20..389ed5b7 100644 --- a/lib/output_buffer.h +++ b/lib/output_buffer.h @@ -1,7 +1,7 @@ #ifndef FIO_OUTPUT_BUFFER_H #define FIO_OUTPUT_BUFFER_H -#include +#include struct buf_output { char *buf; diff --git a/lib/pattern.c b/lib/pattern.c index 31ee4eaf..2024f2e9 100644 --- a/lib/pattern.c +++ b/lib/pattern.c @@ -4,8 +4,6 @@ #include #include #include -#include -#include #include #include diff --git a/lib/pattern.h b/lib/pattern.h index 9f937f02..2d655ad0 100644 --- a/lib/pattern.h +++ b/lib/pattern.h @@ -1,8 +1,6 @@ #ifndef FIO_PARSE_PATTERN_H #define FIO_PARSE_PATTERN_H -struct pattern_fmt; - /** * Pattern format description. The input for 'parse_pattern'. * Describes format with its name and callback, which should diff --git a/lib/prio_tree.c b/lib/prio_tree.c index de3fe1c0..d8e1b89a 100644 --- a/lib/prio_tree.c +++ b/lib/prio_tree.c @@ -11,6 +11,7 @@ * 02Feb2004 Initial version */ +#include #include #include diff --git a/lib/prio_tree.h b/lib/prio_tree.h index e1491dbd..9bd458f1 100644 --- a/lib/prio_tree.h +++ b/lib/prio_tree.h @@ -2,7 +2,6 @@ #define _LINUX_PRIO_TREE_H #include -#include "../hash.h" struct prio_tree_node { struct prio_tree_node *left; diff --git a/lib/rand.c b/lib/rand.c index 3f60a67a..46ffe4fb 100644 --- a/lib/rand.c +++ b/lib/rand.c @@ -34,7 +34,6 @@ */ #include -#include #include "rand.h" #include "pattern.h" #include "../hash.h" diff --git a/lib/rand.h b/lib/rand.h index bff4a351..8832c73a 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -4,7 +4,6 @@ #include #include #include "types.h" -#include "../arch/arch.h" #define FRAND32_MAX (-1U) #define FRAND64_MAX (-1ULL) diff --git a/lib/strntol.h b/lib/strntol.h index 68f5d1b7..59c090d3 100644 --- a/lib/strntol.h +++ b/lib/strntol.h @@ -1,6 +1,8 @@ #ifndef FIO_STRNTOL_H #define FIO_STRNTOL_H +#include + long strntol(const char *str, size_t sz, char **end, int base); #endif diff --git a/lib/zipf.c b/lib/zipf.c index 3d535c79..1ff85680 100644 --- a/lib/zipf.c +++ b/lib/zipf.c @@ -1,11 +1,5 @@ #include #include -#include -#include -#include -#include -#include -#include "ieee754.h" #include "zipf.h" #include "../minmax.h" #include "../hash.h" diff --git a/lib/zipf.h b/lib/zipf.h index af2d0e64..a4aa163c 100644 --- a/lib/zipf.h +++ b/lib/zipf.h @@ -3,6 +3,7 @@ #include #include "rand.h" +#include "types.h" struct zipf_state { uint64_t nranges; diff --git a/libfio.c b/libfio.c index 80159b4d..6faf32a4 100644 --- a/libfio.c +++ b/libfio.c @@ -23,7 +23,6 @@ */ #include -#include #include #include #include diff --git a/log.c b/log.c index 7e8b13b3..46e5034e 100644 --- a/log.c +++ b/log.c @@ -1,5 +1,4 @@ #include -#include #include #include #include diff --git a/memory.c b/memory.c index 04dc3be8..5f0225f7 100644 --- a/memory.c +++ b/memory.c @@ -1,11 +1,10 @@ /* * Memory helpers */ -#include -#include #include #include #include +#include #include "fio.h" #ifndef FIO_NO_HAVE_SHM_H diff --git a/options.c b/options.c index 68105212..45a5b82b 100644 --- a/options.c +++ b/options.c @@ -4,16 +4,12 @@ #include #include #include -#include -#include -#include #include #include #include "fio.h" #include "verify.h" #include "parse.h" -#include "lib/fls.h" #include "lib/pattern.h" #include "options.h" #include "optgroup.h" diff --git a/options.h b/options.h index 83a58e27..59024efc 100644 --- a/options.h +++ b/options.h @@ -6,7 +6,6 @@ #include #include #include "parse.h" -#include "flist.h" #include "lib/types.h" int add_option(struct fio_option *); diff --git a/oslib/strlcat.h b/oslib/strlcat.h index baeace40..720034fe 100644 --- a/oslib/strlcat.h +++ b/oslib/strlcat.h @@ -1,6 +1,8 @@ #ifndef FIO_STRLCAT_H #define FIO_STRLCAT_H +#include + size_t strlcat(char *dst, const char *src, size_t size); #endif diff --git a/oslib/strndup.c b/oslib/strndup.c index 7b0fcb51..40e92f82 100644 --- a/oslib/strndup.c +++ b/oslib/strndup.c @@ -1,4 +1,5 @@ #include + #include "strndup.h" #ifndef CONFIG_HAVE_STRNDUP diff --git a/parse.c b/parse.c index fdb66115..33fcf465 100644 --- a/parse.c +++ b/parse.c @@ -3,18 +3,16 @@ */ #include #include -#include #include #include #include #include -#include -#include #include #include "compiler/compiler.h" #include "parse.h" #include "debug.h" +#include "log.h" #include "options.h" #include "optgroup.h" #include "minmax.h" diff --git a/server.c b/server.c index 65d4484e..6f858109 100644 --- a/server.c +++ b/server.c @@ -1,8 +1,6 @@ #include #include -#include #include -#include #include #include #include @@ -25,7 +23,7 @@ #include "server.h" #include "crc/crc16.h" #include "lib/ieee754.h" -#include "verify.h" +#include "verify-state.h" #include "smalloc.h" int fio_net_port = FIO_NET_PORT; diff --git a/server.h b/server.h index d652d31c..1eee7dcf 100644 --- a/server.h +++ b/server.h @@ -7,7 +7,6 @@ #include #include "stat.h" -#include "os/os.h" #include "diskutil.h" #define FIO_NET_PORT 8765 @@ -217,8 +216,6 @@ extern int fio_server_parse_host(const char *, int, struct in_addr *, struct in6 extern const char *fio_server_op(unsigned int); extern void fio_server_got_signal(int); -struct thread_stat; -struct group_run_stats; extern void fio_server_send_ts(struct thread_stat *, struct group_run_stats *); extern void fio_server_send_gs(struct group_run_stats *); extern void fio_server_send_du(void); diff --git a/smalloc.c b/smalloc.c index 13995acc..7b1690ad 100644 --- a/smalloc.c +++ b/smalloc.c @@ -3,15 +3,8 @@ * that can be shared across processes and threads */ #include -#include -#include #include #include -#include -#include -#include -#include -#include #ifdef CONFIG_VALGRIND_DEV #include #else @@ -22,7 +15,6 @@ #include "fio.h" #include "fio_sem.h" -#include "arch/arch.h" #include "os/os.h" #include "smalloc.h" #include "log.h" diff --git a/smalloc.h b/smalloc.h index 4b551e3e..8df10e6f 100644 --- a/smalloc.h +++ b/smalloc.h @@ -1,6 +1,8 @@ #ifndef FIO_SMALLOC_H #define FIO_SMALLOC_H +#include + extern void *smalloc(size_t); extern void *scalloc(size_t, size_t); extern void sfree(void *); diff --git a/stat.c b/stat.c index 98ab6389..a837ed90 100644 --- a/stat.c +++ b/stat.c @@ -1,10 +1,7 @@ #include #include #include -#include #include -#include -#include #include #include "fio.h" diff --git a/steadystate.c b/steadystate.c index 2017ca67..1e3a5468 100644 --- a/steadystate.c +++ b/steadystate.c @@ -2,7 +2,6 @@ #include "fio.h" #include "steadystate.h" -#include "helper_thread.h" bool steadystate_enabled = false; diff --git a/steadystate.h b/steadystate.h index 9fd88ee8..51472c46 100644 --- a/steadystate.h +++ b/steadystate.h @@ -1,9 +1,7 @@ #ifndef FIO_STEADYSTATE_H #define FIO_STEADYSTATE_H -#include "stat.h" #include "thread_options.h" -#include "lib/ieee754.h" extern void steadystate_free(struct thread_data *); extern void steadystate_check(void); diff --git a/t/axmap.c b/t/axmap.c index a803ce47..eef464ff 100644 --- a/t/axmap.c +++ b/t/axmap.c @@ -1,8 +1,5 @@ #include #include -#include -#include -#include #include #include "../lib/lfsr.h" diff --git a/t/btrace2fio.c b/t/btrace2fio.c index 4cdb38d1..a8a9d629 100644 --- a/t/btrace2fio.c +++ b/t/btrace2fio.c @@ -1,5 +1,4 @@ #include -#include #include #include #include @@ -12,6 +11,7 @@ #include "../blktrace_api.h" #include "../os/os.h" #include "../log.h" +#include "../minmax.h" #include "../oslib/linux-dev-lookup.h" #define TRACE_FIFO_SIZE 8192 diff --git a/t/dedupe.c b/t/dedupe.c index 1b4277c1..37120e18 100644 --- a/t/dedupe.c +++ b/t/dedupe.c @@ -3,16 +3,12 @@ * just scans the filename for extents of the given size, checksums them, * and orders them up. */ +#include +#include #include -#include +#include #include -#include -#include -#include #include -#include -#include -#include #include "../flist.h" #include "../log.h" diff --git a/t/gen-rand.c b/t/gen-rand.c index 4e9d39c6..c379053d 100644 --- a/t/gen-rand.c +++ b/t/gen-rand.c @@ -1,17 +1,11 @@ +#include +#include #include #include -#include -#include -#include -#include #include "../lib/types.h" -#include "../log.h" -#include "../lib/lfsr.h" -#include "../lib/axmap.h" -#include "../smalloc.h" -#include "../minmax.h" #include "../lib/rand.h" +#include "../log.h" int main(int argc, char *argv[]) { diff --git a/t/genzipf.c b/t/genzipf.c index 9faec389..4fc10ae7 100644 --- a/t/genzipf.c +++ b/t/genzipf.c @@ -14,7 +14,6 @@ */ #include #include -#include #include #include diff --git a/t/lfsr-test.c b/t/lfsr-test.c index 4009b62e..abdbafb5 100644 --- a/t/lfsr-test.c +++ b/t/lfsr-test.c @@ -1,11 +1,7 @@ #include #include -#include #include #include -#include -#include -#include #include "../lib/lfsr.h" #include "../gettime.h" diff --git a/td_error.h b/td_error.h index 1b38a534..1cc3a753 100644 --- a/td_error.h +++ b/td_error.h @@ -1,6 +1,8 @@ #ifndef FIO_TD_ERROR_H #define FIO_TD_ERROR_H +#include "io_ddir.h" + /* * What type of errors to continue on when continue_on_error is used, * and what type of errors to ignore when ignore_error is used. diff --git a/trim.c b/trim.c index 78cf6724..bf825db3 100644 --- a/trim.c +++ b/trim.c @@ -1,11 +1,8 @@ /* * TRIM/DISCARD support */ -#include -#include #include #include -#include #include "fio.h" #include "trim.h" diff --git a/trim.h b/trim.h index 37f5d7c8..fe8f9fe9 100644 --- a/trim.h +++ b/trim.h @@ -1,9 +1,13 @@ #ifndef FIO_TRIM_H #define FIO_TRIM_H -#include "fio.h" - #ifdef FIO_HAVE_TRIM +#include "flist.h" +#include "iolog.h" +#include "compiler/compiler.h" +#include "lib/types.h" +#include "os/os.h" + extern bool __must_check get_next_trim(struct thread_data *td, struct io_u *io_u); extern bool io_u_should_trim(struct thread_data *td, struct io_u *io_u); diff --git a/verify.h b/verify.h index 321e6485..64121a51 100644 --- a/verify.h +++ b/verify.h @@ -2,6 +2,7 @@ #define FIO_VERIFY_H #include +#include "compiler/compiler.h" #include "verify-state.h" #define FIO_HDR_MAGIC 0xacca diff --git a/workqueue.h b/workqueue.h index e35c181a..0a62b5f7 100644 --- a/workqueue.h +++ b/workqueue.h @@ -1,7 +1,14 @@ #ifndef FIO_RATE_H #define FIO_RATE_H +#include +#include + #include "flist.h" +#include "lib/types.h" + +struct sk_out; +struct thread_data; struct workqueue_work { struct flist_head list; -- 2.25.1