summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSitsofe Wheeler <sitsofe@yahoo.com>2018-03-19 05:33:13 +0000
committerSitsofe Wheeler <sitsofe@yahoo.com>2018-03-21 22:09:28 +0000
commit3d2d14bcb844e72809192311369a642c5d415472 (patch)
tree122bf381752fe506a9db265c5199178261a6ab9f
parent0f0346e0c8f9141ceea8a5de8264c635ea0cae9b (diff)
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 <sitsofe@yahoo.com>
-rw-r--r--backend.c12
-rw-r--r--blktrace.c2
-rw-r--r--cconv.c1
-rw-r--r--cgroup.c1
-rw-r--r--client.c4
-rw-r--r--client.h6
-rw-r--r--compiler/compiler.h1
-rw-r--r--crc/crc32.c1
-rw-r--r--crc/crc32.h2
-rw-r--r--crc/crc32c-intel.c7
-rw-r--r--crc/crc32c.c2
-rw-r--r--crc/crc32c.h2
-rw-r--r--crc/md5.c1
-rw-r--r--crc/sha1.h2
-rw-r--r--crc/sha256.c1
-rw-r--r--crc/sha256.h2
-rw-r--r--crc/sha3.c1
-rw-r--r--crc/sha512.c1
-rw-r--r--crc/sha512.h2
-rw-r--r--crc/test.c5
-rw-r--r--debug.c5
-rw-r--r--debug.h2
-rw-r--r--diskutil.c3
-rw-r--r--diskutil.h1
-rw-r--r--engines/e4defrag.c4
-rw-r--r--engines/falloc.c4
-rw-r--r--engines/filecreate.c2
-rw-r--r--engines/ftruncate.c8
-rw-r--r--engines/libaio.c2
-rw-r--r--engines/mmap.c1
-rw-r--r--engines/mtd.c3
-rw-r--r--engines/net.c2
-rw-r--r--engines/null.c3
-rw-r--r--engines/sg.c1
-rw-r--r--engines/splice.c1
-rw-r--r--engines/sync.c1
-rw-r--r--eta.c1
-rw-r--r--fifo.c1
-rw-r--r--fifo.h1
-rw-r--r--filesetup.c2
-rw-r--r--fio.c5
-rw-r--r--fio.h1
-rw-r--r--fio_sem.c2
-rw-r--r--fio_time.h1
-rw-r--r--gettime-thread.c2
-rw-r--r--gettime.c7
-rw-r--r--gettime.h2
-rw-r--r--helpers.c9
-rw-r--r--helpers.h5
-rw-r--r--idletime.c1
-rw-r--r--idletime.h5
-rw-r--r--init.c2
-rw-r--r--io_u.c4
-rw-r--r--io_u.h1
-rw-r--r--io_u_queue.h2
-rw-r--r--ioengines.c1
-rw-r--r--ioengines.h5
-rw-r--r--iolog.c2
-rw-r--r--iolog.h2
-rw-r--r--json.c1
-rw-r--r--json.h4
-rw-r--r--lib/bloom.c2
-rw-r--r--lib/gauss.c1
-rw-r--r--lib/ieee754.c1
-rw-r--r--lib/lfsr.c1
-rw-r--r--lib/memalign.c3
-rw-r--r--lib/memalign.h2
-rw-r--r--lib/memcpy.c3
-rw-r--r--lib/num2str.c1
-rw-r--r--lib/output_buffer.c1
-rw-r--r--lib/output_buffer.h2
-rw-r--r--lib/pattern.c2
-rw-r--r--lib/pattern.h2
-rw-r--r--lib/prio_tree.c1
-rw-r--r--lib/prio_tree.h1
-rw-r--r--lib/rand.c1
-rw-r--r--lib/rand.h1
-rw-r--r--lib/strntol.h2
-rw-r--r--lib/zipf.c6
-rw-r--r--lib/zipf.h1
-rw-r--r--libfio.c1
-rw-r--r--log.c1
-rw-r--r--memory.c3
-rw-r--r--options.c4
-rw-r--r--options.h1
-rw-r--r--oslib/strlcat.h2
-rw-r--r--oslib/strndup.c1
-rw-r--r--parse.c4
-rw-r--r--server.c4
-rw-r--r--server.h3
-rw-r--r--smalloc.c8
-rw-r--r--smalloc.h2
-rw-r--r--stat.c3
-rw-r--r--steadystate.c1
-rw-r--r--steadystate.h2
-rw-r--r--t/axmap.c3
-rw-r--r--t/btrace2fio.c2
-rw-r--r--t/dedupe.c10
-rw-r--r--t/gen-rand.c12
-rw-r--r--t/genzipf.c1
-rw-r--r--t/lfsr-test.c4
-rw-r--r--td_error.h2
-rw-r--r--trim.c3
-rw-r--r--trim.h8
-rw-r--r--verify.h1
-rw-r--r--workqueue.h7
106 files changed, 83 insertions, 212 deletions
diff --git a/backend.c b/backend.c
index d82d494..a92b1e3 100644
--- a/backend.c
+++ b/backend.c
@@ -22,29 +22,17 @@
*
*/
#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
-#include <limits.h>
#include <signal.h>
-#include <time.h>
-#include <locale.h>
#include <assert.h>
-#include <time.h>
#include <inttypes.h>
#include <sys/stat.h>
#include <sys/wait.h>
-#include <sys/ipc.h>
-#include <sys/mman.h>
#include <math.h>
#include "fio.h"
-#ifndef FIO_NO_HAVE_SHM_H
-#include <sys/shm.h>
-#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 4b791d7..6e4d0a4 100644
--- a/blktrace.c
+++ b/blktrace.c
@@ -3,10 +3,8 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <sys/stat.h>
#include <sys/ioctl.h>
#include <linux/fs.h>
-#include <dirent.h>
#include "flist.h"
#include "fio.h"
diff --git a/cconv.c b/cconv.c
index 92996b1..dbe0071 100644
--- a/cconv.c
+++ b/cconv.c
@@ -1,5 +1,6 @@
#include <string.h>
+#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 4fab977..380e37e 100644
--- a/cgroup.c
+++ b/cgroup.c
@@ -5,7 +5,6 @@
#include <stdlib.h>
#include <mntent.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include "fio.h"
#include "flist.h"
#include "cgroup.h"
diff --git a/client.c b/client.c
index bff0adc..43825d9 100644
--- a/client.c
+++ b/client.c
@@ -1,13 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <limits.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/poll.h>
#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/wait.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
@@ -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 90082a3..29e84d0 100644
--- a/client.h
+++ b/client.h
@@ -1,7 +1,6 @@
#ifndef CLIENT_H
#define CLIENT_H
-#include <sys/socket.h>
#include <sys/un.h>
#include <netinet/in.h>
#include <arpa/inet.h>
@@ -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 91a9883..8488aa0 100644
--- a/compiler/compiler.h
+++ b/compiler/compiler.h
@@ -1,6 +1,5 @@
#ifndef FIO_COMPILER_H
#define FIO_COMPILER_H
-#include <assert.h>
#if __GNUC__ >= 4
#include "compiler-gcc4.h"
diff --git a/crc/crc32.c b/crc/crc32.c
index 4140a8d..e35f5d9 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 <inttypes.h>
#include "crc32.h"
static const uint32_t crctab[256] = {
diff --git a/crc/crc32.h b/crc/crc32.h
index a37d7ad..6378e81 100644
--- a/crc/crc32.h
+++ b/crc/crc32.h
@@ -18,6 +18,8 @@
#ifndef CRC32_H
#define CRC32_H
+#include <inttypes.h>
+
extern uint32_t fio_crc32(const void * const, unsigned long);
#endif
diff --git a/crc/crc32c-intel.c b/crc/crc32c-intel.c
index 05a087d..9a2cefd 100644
--- a/crc/crc32c-intel.c
+++ b/crc/crc32c-intel.c
@@ -1,10 +1,3 @@
-#include <inttypes.h>
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
#include "crc32c.h"
/*
diff --git a/crc/crc32c.c b/crc/crc32c.c
index f6fc688..34944ae 100644
--- a/crc/crc32c.c
+++ b/crc/crc32c.c
@@ -30,8 +30,6 @@
* any later version.
*
*/
-#include <inttypes.h>
-
#include "crc32c.h"
/*
diff --git a/crc/crc32c.h b/crc/crc32c.h
index be03c1a..60f6014 100644
--- a/crc/crc32c.h
+++ b/crc/crc32c.h
@@ -18,6 +18,8 @@
#ifndef CRC32C_H
#define CRC32C_H
+#include <inttypes.h>
+
#include "../arch/arch.h"
#include "../lib/types.h"
diff --git a/crc/md5.c b/crc/md5.c
index 64fe48a..ade4f69 100644
--- a/crc/md5.c
+++ b/crc/md5.c
@@ -2,7 +2,6 @@
* Shamelessly lifted from the 2.6 kernel (crypto/md5.c)
*/
#include <string.h>
-#include <stdint.h>
#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 75317f7..416199b 100644
--- a/crc/sha1.h
+++ b/crc/sha1.h
@@ -1,6 +1,8 @@
#ifndef FIO_SHA1
#define FIO_SHA1
+#include <inttypes.h>
+
/*
* 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 2fd17a3..2b39c42 100644
--- a/crc/sha256.c
+++ b/crc/sha256.c
@@ -17,7 +17,6 @@
*
*/
#include <string.h>
-#include <inttypes.h>
#include "../lib/bswap.h"
#include "sha256.h"
diff --git a/crc/sha256.h b/crc/sha256.h
index b636033..b904c7d 100644
--- a/crc/sha256.h
+++ b/crc/sha256.h
@@ -1,6 +1,8 @@
#ifndef FIO_SHA256_H
#define FIO_SHA256_H
+#include <inttypes.h>
+
#define SHA256_DIGEST_SIZE 32
#define SHA256_BLOCK_SIZE 64
diff --git a/crc/sha3.c b/crc/sha3.c
index 2685dce..c136550 100644
--- a/crc/sha3.c
+++ b/crc/sha3.c
@@ -13,7 +13,6 @@
*
*/
#include <string.h>
-#include <inttypes.h>
#include "../os/os.h"
diff --git a/crc/sha512.c b/crc/sha512.c
index e069a44..f599cdc 100644
--- a/crc/sha512.c
+++ b/crc/sha512.c
@@ -12,7 +12,6 @@
*/
#include <string.h>
-#include <inttypes.h>
#include "../lib/bswap.h"
#include "sha512.h"
diff --git a/crc/sha512.h b/crc/sha512.h
index f8b2112..5adf627 100644
--- a/crc/sha512.h
+++ b/crc/sha512.h
@@ -1,6 +1,8 @@
#ifndef FIO_SHA512_H
#define FIO_SHA512_H
+#include <inttypes.h>
+
struct fio_sha512_ctx {
uint64_t state[8];
uint32_t count[4];
diff --git a/crc/test.c b/crc/test.c
index b119872..b57f07a 100644
--- a/crc/test.c
+++ b/crc/test.c
@@ -1,11 +1,12 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#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 2bee507..d1e2987 100644
--- a/debug.c
+++ b/debug.c
@@ -1,7 +1,8 @@
+#include <assert.h>
#include <stdarg.h>
-#include <sys/types.h>
-#include <unistd.h>
+
#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 1765fdb..8a8cf87 100644
--- a/debug.h
+++ b/debug.h
@@ -1,9 +1,7 @@
#ifndef FIO_DEBUG_H
#define FIO_DEBUG_H
-#include <assert.h>
#include "lib/types.h"
-#include "log.h"
enum {
FD_PROCESS = 0,
diff --git a/diskutil.c b/diskutil.c
index dd8fc6a..b973120 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -1,13 +1,10 @@
#include <stdio.h>
#include <string.h>
-#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
#include <dirent.h>
#include <libgen.h>
-#include <math.h>
-#include <assert.h>
#ifdef CONFIG_VALGRIND_DEV
#include <valgrind/drd.h>
#else
diff --git a/diskutil.h b/diskutil.h
index c103578..15ec681 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 4b44488..3619450 100644
--- a/engines/e4defrag.c
+++ b/engines/e4defrag.c
@@ -9,11 +9,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/uio.h>
#include <errno.h>
-#include <assert.h>
#include <fcntl.h>
#include "../fio.h"
diff --git a/engines/falloc.c b/engines/falloc.c
index 2b00d52..bb3ac85 100644
--- a/engines/falloc.c
+++ b/engines/falloc.c
@@ -9,11 +9,7 @@
*
*/
#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/uio.h>
#include <errno.h>
-#include <assert.h>
#include <fcntl.h>
#include "../fio.h"
diff --git a/engines/filecreate.c b/engines/filecreate.c
index 0c3bcdd..6fa041c 100644
--- a/engines/filecreate.c
+++ b/engines/filecreate.c
@@ -5,12 +5,10 @@
* of the file creation.
*/
#include <stdio.h>
-#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#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 e86dbac..14e115f 100644
--- a/engines/ftruncate.c
+++ b/engines/ftruncate.c
@@ -6,16 +6,10 @@
* DDIR_WRITE does ftruncate
*
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/uio.h>
#include <errno.h>
-#include <assert.h>
-#include <fcntl.h>
+#include <unistd.h>
#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 e0d7cbb..7d59df3 100644
--- a/engines/libaio.c
+++ b/engines/libaio.c
@@ -4,11 +4,9 @@
* IO engine using the Linux native aio interface.
*
*/
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <assert.h>
#include <libaio.h>
#include "../fio.h"
diff --git a/engines/mmap.c b/engines/mmap.c
index ea7179d..9dbefc8 100644
--- a/engines/mmap.c
+++ b/engines/mmap.c
@@ -7,7 +7,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <errno.h>
#include <sys/mman.h>
diff --git a/engines/mtd.c b/engines/mtd.c
index b4a6600..5f822fc 100644
--- a/engines/mtd.c
+++ b/engines/mtd.c
@@ -4,17 +4,14 @@
* IO engine that reads/writes from MTD character devices.
*
*/
-#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <errno.h>
#include <sys/ioctl.h>
#include <mtd/mtd-user.h>
#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 37d44fd..9b385b0 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -9,13 +9,11 @@
#include <unistd.h>
#include <signal.h>
#include <errno.h>
-#include <assert.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <sys/poll.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/engines/null.c b/engines/null.c
index 0cfc22a..8c26ad7 100644
--- a/engines/null.c
+++ b/engines/null.c
@@ -13,10 +13,7 @@
* LD_LIBRARY_PATH=./engines ./fio examples/cpp_null.fio
*
*/
-#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
#include <assert.h>
#include "../fio.h"
diff --git a/engines/sg.c b/engines/sg.c
index f240755..7b18c28 100644
--- a/engines/sg.c
+++ b/engines/sg.c
@@ -8,7 +8,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <assert.h>
#include <sys/poll.h>
#include "../fio.h"
diff --git a/engines/splice.c b/engines/splice.c
index d5d8ab0..d322f40 100644
--- a/engines/splice.c
+++ b/engines/splice.c
@@ -9,7 +9,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#include <assert.h>
#include <sys/poll.h>
#include <sys/mman.h>
diff --git a/engines/sync.c b/engines/sync.c
index 26b98b6..d5b4012 100644
--- a/engines/sync.c
+++ b/engines/sync.c
@@ -10,7 +10,6 @@
#include <unistd.h>
#include <sys/uio.h>
#include <errno.h>
-#include <assert.h>
#include "../fio.h"
#include "../optgroup.h"
diff --git a/eta.c b/eta.c
index 3126f21..2d549ee 100644
--- a/eta.c
+++ b/eta.c
@@ -2,7 +2,6 @@
* Status and ETA code
*/
#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
#ifdef CONFIG_VALGRIND_DEV
#include <valgrind/drd.h>
diff --git a/fifo.c b/fifo.c
index 98737e9..ac0d215 100644
--- a/fifo.c
+++ b/fifo.c
@@ -24,6 +24,7 @@
#include <string.h>
#include "fifo.h"
+#include "minmax.h"
struct fifo *fifo_alloc(unsigned int size)
{
diff --git a/fifo.h b/fifo.h
index 5e3d339..61cc5a8 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 7cbce13..c115f7b 100644
--- a/filesetup.c
+++ b/filesetup.c
@@ -5,8 +5,6 @@
#include <dirent.h>
#include <libgen.h>
#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/types.h>
#include "fio.h"
#include "smalloc.h"
diff --git a/fio.c b/fio.c
index 7b61ffc..f19db1b 100644
--- a/fio.c
+++ b/fio.c
@@ -21,12 +21,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
-#include <unistd.h>
-#include <locale.h>
-#include <time.h>
-
#include "fio.h"
-#include "smalloc.h"
int main(int argc, char *argv[], char *envp[])
{
diff --git a/fio.h b/fio.h
index 9551048..488fa9a 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 20fcfcc..3b48061 100644
--- a/fio_sem.c
+++ b/fio_sem.c
@@ -1,3 +1,4 @@
+#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
#include <assert.h>
@@ -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 8b4bb25..39fb17b 100644
--- a/fio_time.h
+++ b/fio_time.h
@@ -1,6 +1,7 @@
#ifndef FIO_TIME_H
#define FIO_TIME_H
+#include <stdint.h>
#include <time.h>
#include <sys/time.h>
#include "lib/types.h"
diff --git a/gettime-thread.c b/gettime-thread.c
index 87f5060..eb535a0 100644
--- a/gettime-thread.c
+++ b/gettime-thread.c
@@ -1,5 +1,3 @@
-#include <unistd.h>
-#include <math.h>
#include <sys/time.h>
#include <time.h>
diff --git a/gettime.c b/gettime.c
index 57c66f7..87fc29b 100644
--- a/gettime.c
+++ b/gettime.c
@@ -2,16 +2,9 @@
* Clock functions
*/
-#include <unistd.h>
#include <math.h>
-#include <sys/time.h>
-#include <time.h>
#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 11e2a7b..1c4a25c 100644
--- a/gettime.h
+++ b/gettime.h
@@ -1,6 +1,8 @@
#ifndef FIO_GETTIME_H
#define FIO_GETTIME_H
+#include <sys/time.h>
+
#include "arch/arch.h"
/*
diff --git a/helpers.c b/helpers.c
index 4342b2d..a0ee370 100644
--- a/helpers.c
+++ b/helpers.c
@@ -1,13 +1,6 @@
-#include <stdlib.h>
#include <errno.h>
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <netinet/in.h>
-#include <unistd.h>
-#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 5f1865b..a0b3285 100644
--- a/helpers.h
+++ b/helpers.h
@@ -1,10 +1,9 @@
#ifndef FIO_HELPERS_H
#define FIO_HELPERS_H
-#include "compiler/compiler.h"
-
#include <sys/types.h>
-#include <time.h>
+
+#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 90bc1d9..8762c85 100644
--- a/idletime.c
+++ b/idletime.c
@@ -1,4 +1,5 @@
#include <math.h>
+#include "fio.h"
#include "json.h"
#include "idletime.h"
diff --git a/idletime.h b/idletime.h
index b8376c2..6c1161a 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 <sys/time.h>
+#include <sys/types.h>
+#include "os/os.h"
#define CALIBRATE_RUNS 10
#define CALIBRATE_SCALE 1000
diff --git a/init.c b/init.c
index e47e538..ab7e399 100644
--- a/init.c
+++ b/init.c
@@ -4,13 +4,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <sys/ipc.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <dlfcn.h>
#ifdef CONFIG_VALGRIND_DEV
#include <valgrind/drd.h>
diff --git a/io_u.c b/io_u.c
index f3b5932..98a7dc5 100644
--- a/io_u.c
+++ b/io_u.c
@@ -1,12 +1,8 @@
#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
-#include <signal.h>
-#include <time.h>
#include <assert.h>
#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 da25efb..aaa7d97 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 b5b8d2f..545e2c4 100644
--- a/io_u_queue.h
+++ b/io_u_queue.h
@@ -2,6 +2,8 @@
#define FIO_IO_U_QUEUE
#include <assert.h>
+#include <stddef.h>
+
#include "lib/types.h"
struct io_u;
diff --git a/ioengines.c b/ioengines.c
index 965581a..a8ec79d 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -9,7 +9,6 @@
* generic io engine that could be used for other projects.
*
*/
-#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
diff --git a/ioengines.h b/ioengines.h
index 32b18ed..a0674ae 100644
--- a/ioengines.h
+++ b/ioengines.h
@@ -1,9 +1,10 @@
#ifndef FIO_IOENGINE_H
#define FIO_IOENGINE_H
+#include <stddef.h>
+
#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 460d7a2..2b5eaf0 100644
--- a/iolog.c
+++ b/iolog.c
@@ -4,7 +4,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <libgen.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
@@ -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 70981f9..f70eb61 100644
--- a/iolog.h
+++ b/iolog.h
@@ -1,6 +1,8 @@
#ifndef FIO_IOLOG_H
#define FIO_IOLOG_H
+#include <stdio.h>
+
#include "lib/rbtree.h"
#include "lib/ieee754.h"
#include "flist.h"
diff --git a/json.c b/json.c
index e0227ec..75212c8 100644
--- a/json.c
+++ b/json.c
@@ -1,6 +1,5 @@
#include <stdlib.h>
#include <string.h>
-#include <stdio.h>
#include <errno.h>
#include <stdarg.h>
#include "json.h"
diff --git a/json.h b/json.h
index d7017e0..bcc712c 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 bb81dbb..f4f9b6b 100644
--- a/lib/bloom.c
+++ b/lib/bloom.c
@@ -1,9 +1,7 @@
#include <stdlib.h>
-#include <inttypes.h>
#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 f974490..1d24e18 100644
--- a/lib/gauss.c
+++ b/lib/gauss.c
@@ -1,6 +1,5 @@
#include <math.h>
#include <string.h>
-#include <stdio.h>
#include "../hash.h"
#include "gauss.h"
diff --git a/lib/ieee754.c b/lib/ieee754.c
index c7742a2..2154065 100644
--- a/lib/ieee754.c
+++ b/lib/ieee754.c
@@ -5,7 +5,6 @@
*
* Below code was granted to the public domain.
*/
-#include <inttypes.h>
#include "ieee754.h"
uint64_t pack754(long double f, unsigned bits, unsigned expbits)
diff --git a/lib/lfsr.c b/lib/lfsr.c
index 0c0072c..a4f1fb1 100644
--- a/lib/lfsr.c
+++ b/lib/lfsr.c
@@ -1,5 +1,4 @@
#include <stdio.h>
-#include <math.h>
#include "lfsr.h"
#include "../compiler/compiler.h"
diff --git a/lib/memalign.c b/lib/memalign.c
index bfbd1e8..e774c19 100644
--- a/lib/memalign.c
+++ b/lib/memalign.c
@@ -1,6 +1,5 @@
-#include <stdlib.h>
#include <assert.h>
-#include <inttypes.h>
+#include <stdlib.h>
#include "memalign.h"
diff --git a/lib/memalign.h b/lib/memalign.h
index df412e2..c2eb170 100644
--- a/lib/memalign.h
+++ b/lib/memalign.h
@@ -1,6 +1,8 @@
#ifndef FIO_MEMALIGN_H
#define FIO_MEMALIGN_H
+#include <inttypes.h>
+
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 00e65aa..cf8572e 100644
--- a/lib/memcpy.c
+++ b/lib/memcpy.c
@@ -1,3 +1,4 @@
+#include <inttypes.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -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 8d08841..387c5d7 100644
--- a/lib/num2str.c
+++ b/lib/num2str.c
@@ -1,3 +1,4 @@
+#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
diff --git a/lib/output_buffer.c b/lib/output_buffer.c
index f6c304b..beb8a14 100644
--- a/lib/output_buffer.c
+++ b/lib/output_buffer.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
#include <string.h>
#include <stdlib.h>
diff --git a/lib/output_buffer.h b/lib/output_buffer.h
index a235af2..389ed5b 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 <unistd.h>
+#include <stddef.h>
struct buf_output {
char *buf;
diff --git a/lib/pattern.c b/lib/pattern.c
index 31ee4ea..2024f2e 100644
--- a/lib/pattern.c
+++ b/lib/pattern.c
@@ -4,8 +4,6 @@
#include <limits.h>
#include <errno.h>
#include <assert.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
diff --git a/lib/pattern.h b/lib/pattern.h
index 9f937f0..2d655ad 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 de3fe1c..d8e1b89 100644
--- a/lib/prio_tree.c
+++ b/lib/prio_tree.c
@@ -11,6 +11,7 @@
* 02Feb2004 Initial version
*/
+#include <assert.h>
#include <stdlib.h>
#include <limits.h>
diff --git a/lib/prio_tree.h b/lib/prio_tree.h
index e1491db..9bd458f 100644
--- a/lib/prio_tree.h
+++ b/lib/prio_tree.h
@@ -2,7 +2,6 @@
#define _LINUX_PRIO_TREE_H
#include <inttypes.h>
-#include "../hash.h"
struct prio_tree_node {
struct prio_tree_node *left;
diff --git a/lib/rand.c b/lib/rand.c
index 3f60a67..46ffe4f 100644
--- a/lib/rand.c
+++ b/lib/rand.c
@@ -34,7 +34,6 @@
*/
#include <string.h>
-#include <assert.h>
#include "rand.h"
#include "pattern.h"
#include "../hash.h"
diff --git a/lib/rand.h b/lib/rand.h
index bff4a35..8832c73 100644
--- a/lib/rand.h
+++ b/lib/rand.h
@@ -4,7 +4,6 @@
#include <inttypes.h>
#include <assert.h>
#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 68f5d1b..59c090d 100644
--- a/lib/strntol.h
+++ b/lib/strntol.h
@@ -1,6 +1,8 @@
#ifndef FIO_STRNTOL_H
#define FIO_STRNTOL_H
+#include <stdint.h>
+
long strntol(const char *str, size_t sz, char **end, int base);
#endif
diff --git a/lib/zipf.c b/lib/zipf.c
index 3d535c7..1ff8568 100644
--- a/lib/zipf.c
+++ b/lib/zipf.c
@@ -1,11 +1,5 @@
#include <math.h>
#include <string.h>
-#include <inttypes.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include "ieee754.h"
#include "zipf.h"
#include "../minmax.h"
#include "../hash.h"
diff --git a/lib/zipf.h b/lib/zipf.h
index af2d0e6..a4aa163 100644
--- a/lib/zipf.h
+++ b/lib/zipf.h
@@ -3,6 +3,7 @@
#include <inttypes.h>
#include "rand.h"
+#include "types.h"
struct zipf_state {
uint64_t nranges;
diff --git a/libfio.c b/libfio.c
index 80159b4..6faf32a 100644
--- a/libfio.c
+++ b/libfio.c
@@ -23,7 +23,6 @@
*/
#include <string.h>
-#include <sys/types.h>
#include <signal.h>
#include <stdint.h>
#include <locale.h>
diff --git a/log.c b/log.c
index 7e8b13b..46e5034 100644
--- a/log.c
+++ b/log.c
@@ -1,5 +1,4 @@
#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
#include <stdarg.h>
#include <syslog.h>
diff --git a/memory.c b/memory.c
index 04dc3be..5f0225f 100644
--- a/memory.c
+++ b/memory.c
@@ -1,11 +1,10 @@
/*
* Memory helpers
*/
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
+#include <sys/stat.h>
#include "fio.h"
#ifndef FIO_NO_HAVE_SHM_H
diff --git a/options.c b/options.c
index 6810521..45a5b82 100644
--- a/options.c
+++ b/options.c
@@ -4,16 +4,12 @@
#include <ctype.h>
#include <string.h>
#include <assert.h>
-#include <libgen.h>
-#include <fcntl.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <netinet/in.h>
#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 83a58e2..59024ef 100644
--- a/options.h
+++ b/options.h
@@ -6,7 +6,6 @@
#include <string.h>
#include <inttypes.h>
#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 baeace4..720034f 100644
--- a/oslib/strlcat.h
+++ b/oslib/strlcat.h
@@ -1,6 +1,8 @@
#ifndef FIO_STRLCAT_H
#define FIO_STRLCAT_H
+#include <stddef.h>
+
size_t strlcat(char *dst, const char *src, size_t size);
#endif
diff --git a/oslib/strndup.c b/oslib/strndup.c
index 7b0fcb5..40e92f8 100644
--- a/oslib/strndup.c
+++ b/oslib/strndup.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+
#include "strndup.h"
#ifndef CONFIG_HAVE_STRNDUP
diff --git a/parse.c b/parse.c
index fdb6611..33fcf46 100644
--- a/parse.c
+++ b/parse.c
@@ -3,18 +3,16 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
-#include <stdlib.h>
-#include <math.h>
#include <float.h>
#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 65d4484..6f85810 100644
--- a/server.c
+++ b/server.c
@@ -1,8 +1,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
#include <unistd.h>
-#include <limits.h>
#include <errno.h>
#include <sys/poll.h>
#include <sys/types.h>
@@ -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 d652d31..1eee7dc 100644
--- a/server.h
+++ b/server.h
@@ -7,7 +7,6 @@
#include <netinet/in.h>
#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 13995ac..7b1690a 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -3,15 +3,8 @@
* that can be shared across processes and threads
*/
#include <sys/mman.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <assert.h>
#include <string.h>
-#include <unistd.h>
-#include <inttypes.h>
-#include <sys/types.h>
-#include <limits.h>
-#include <fcntl.h>
#ifdef CONFIG_VALGRIND_DEV
#include <valgrind/valgrind.h>
#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 4b551e3..8df10e6 100644
--- a/smalloc.h
+++ b/smalloc.h
@@ -1,6 +1,8 @@
#ifndef FIO_SMALLOC_H
#define FIO_SMALLOC_H
+#include <stddef.h>
+
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 98ab638..a837ed9 100644
--- a/stat.c
+++ b/stat.c
@@ -1,10 +1,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/time.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <dirent.h>
-#include <libgen.h>
#include <math.h>
#include "fio.h"
diff --git a/steadystate.c b/steadystate.c
index 2017ca6..1e3a546 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 9fd88ee..51472c4 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 a803ce4..eef464f 100644
--- a/t/axmap.c
+++ b/t/axmap.c
@@ -1,8 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
-#include <string.h>
-#include <unistd.h>
#include <inttypes.h>
#include "../lib/lfsr.h"
diff --git a/t/btrace2fio.c b/t/btrace2fio.c
index 4cdb38d..a8a9d62 100644
--- a/t/btrace2fio.c
+++ b/t/btrace2fio.c
@@ -1,5 +1,4 @@
#include <stdio.h>
-#include <stdio.h>
#include <unistd.h>
#include <inttypes.h>
#include <math.h>
@@ -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 1b4277c..37120e1 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 <fcntl.h>
+#include <inttypes.h>
#include <stdio.h>
-#include <stdio.h>
+#include <string.h>
#include <unistd.h>
-#include <inttypes.h>
-#include <assert.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <string.h>
#include "../flist.h"
#include "../log.h"
diff --git a/t/gen-rand.c b/t/gen-rand.c
index 4e9d39c..c379053 100644
--- a/t/gen-rand.c
+++ b/t/gen-rand.c
@@ -1,17 +1,11 @@
+#include <math.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
-#include <inttypes.h>
-#include <assert.h>
-#include <math.h>
-#include <string.h>
#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 9faec38..4fc10ae 100644
--- a/t/genzipf.c
+++ b/t/genzipf.c
@@ -14,7 +14,6 @@
*/
#include <stdio.h>
#include <stdlib.h>
-#include <fcntl.h>
#include <string.h>
#include <unistd.h>
diff --git a/t/lfsr-test.c b/t/lfsr-test.c
index 4009b62..abdbafb 100644
--- a/t/lfsr-test.c
+++ b/t/lfsr-test.c
@@ -1,11 +1,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <time.h>
#include <math.h>
#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include "../lib/lfsr.h"
#include "../gettime.h"
diff --git a/td_error.h b/td_error.h
index 1b38a53..1cc3a75 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 78cf672..bf825db 100644
--- a/trim.c
+++ b/trim.c
@@ -1,11 +1,8 @@
/*
* TRIM/DISCARD support
*/
-#include <unistd.h>
-#include <fcntl.h>
#include <string.h>
#include <assert.h>
-#include <pthread.h>
#include "fio.h"
#include "trim.h"
diff --git a/trim.h b/trim.h
index 37f5d7c..fe8f9fe 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 321e648..64121a5 100644
--- a/verify.h
+++ b/verify.h
@@ -2,6 +2,7 @@
#define FIO_VERIFY_H
#include <stdint.h>
+#include "compiler/compiler.h"
#include "verify-state.h"
#define FIO_HDR_MAGIC 0xacca
diff --git a/workqueue.h b/workqueue.h
index e35c181..0a62b5f 100644
--- a/workqueue.h
+++ b/workqueue.h
@@ -1,7 +1,14 @@
#ifndef FIO_RATE_H
#define FIO_RATE_H
+#include <inttypes.h>
+#include <pthread.h>
+
#include "flist.h"
+#include "lib/types.h"
+
+struct sk_out;
+struct thread_data;
struct workqueue_work {
struct flist_head list;