Refactor #includes and headers
authorSitsofe Wheeler <sitsofe@yahoo.com>
Mon, 19 Mar 2018 05:33:13 +0000 (05:33 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Wed, 21 Mar 2018 22:09:28 +0000 (22:09 +0000)
- 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>
106 files changed:
backend.c
blktrace.c
cconv.c
cgroup.c
client.c
client.h
compiler/compiler.h
crc/crc32.c
crc/crc32.h
crc/crc32c-intel.c
crc/crc32c.c
crc/crc32c.h
crc/md5.c
crc/sha1.h
crc/sha256.c
crc/sha256.h
crc/sha3.c
crc/sha512.c
crc/sha512.h
crc/test.c
debug.c
debug.h
diskutil.c
diskutil.h
engines/e4defrag.c
engines/falloc.c
engines/filecreate.c
engines/ftruncate.c
engines/libaio.c
engines/mmap.c
engines/mtd.c
engines/net.c
engines/null.c
engines/sg.c
engines/splice.c
engines/sync.c
eta.c
fifo.c
fifo.h
filesetup.c
fio.c
fio.h
fio_sem.c
fio_time.h
gettime-thread.c
gettime.c
gettime.h
helpers.c
helpers.h
idletime.c
idletime.h
init.c
io_u.c
io_u.h
io_u_queue.h
ioengines.c
ioengines.h
iolog.c
iolog.h
json.c
json.h
lib/bloom.c
lib/gauss.c
lib/ieee754.c
lib/lfsr.c
lib/memalign.c
lib/memalign.h
lib/memcpy.c
lib/num2str.c
lib/output_buffer.c
lib/output_buffer.h
lib/pattern.c
lib/pattern.h
lib/prio_tree.c
lib/prio_tree.h
lib/rand.c
lib/rand.h
lib/strntol.h
lib/zipf.c
lib/zipf.h
libfio.c
log.c
memory.c
options.c
options.h
oslib/strlcat.h
oslib/strndup.c
parse.c
server.c
server.h
smalloc.c
smalloc.h
stat.c
steadystate.c
steadystate.h
t/axmap.c
t/btrace2fio.c
t/dedupe.c
t/gen-rand.c
t/genzipf.c
t/lfsr-test.c
td_error.h
trim.c
trim.h
verify.h
workqueue.h

index d82d49487c84991b8105508cd419cd557b58182b..a92b1e3c025e1f7f2d4a5500a669f6bea0f7166e 100644 (file)
--- a/backend.c
+++ b/backend.c
  *
  */
 #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"
index 4b791d7eb3f1f0b9b23432840ffcb48ef252ed16..6e4d0a4c9620bdabb9000ff45e6bff60e67a2c5f 100644 (file)
@@ -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 92996b1e430b744b4525d4e9390e528c496ac566..dbe0071a1de885a3e7c01661dabd0959f7615e14 100644 (file)
--- 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)
index 4fab977aeb8c3ddadadf1680692d7bf5210d70dd..380e37e4870684e9c1dec67d4ccbef85150a4ff4 100644 (file)
--- 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"
index bff0adc0d972ed38f2cc7c72961b0e2849693c9a..43825d9e2708aff7155242ae676eb9e5931ca49c 100644 (file)
--- 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);
index 90082a3491db54e2bcaec30b18182231fb1d83d5..29e84d0dc2a126debde76105fd13cf35ecafc439 100644 (file)
--- 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;
index 91a988369eccff1576ac60ef5c65c8cb52fb8310..8488aa0d4bd0ee558c9448561325ce11baa0c0a8 100644 (file)
@@ -1,6 +1,5 @@
 #ifndef FIO_COMPILER_H
 #define FIO_COMPILER_H
-#include <assert.h>
 
 #if __GNUC__ >= 4
 #include "compiler-gcc4.h"
index 4140a8d4ad2ee4788b04ec5c092fc8726daff87c..e35f5d9308fec43927304f31d0d6bb600b48eeae 100644 (file)
@@ -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] = {
index a37d7ada96b3d0255efa96db2d8e30b45e5465d1..6378e815b1c6c7de32620c16febfe54e7c592a0b 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef CRC32_H
 #define CRC32_H
 
+#include <inttypes.h>
+
 extern uint32_t fio_crc32(const void * const, unsigned long);
 
 #endif
index 05a087dcb6060f919deca5dc94699e58eee8bbe5..9a2cefdedcaf288fa5a302c952f21410353b88ea 100644 (file)
@@ -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"
 
 /*
index f6fc688748bfccae5edf0b31bd136a35585978d5..34944aea92dedcd779663b6ba8b8f99d857cc43e 100644 (file)
@@ -30,8 +30,6 @@
  * any later version.
  *
  */
-#include <inttypes.h>
-
 #include "crc32c.h"
 
 /*
index be03c1a27cc28ad851b55e5bd47e2dbb5192a690..60f60141966e90211f277fc5ab6dec563145f83e 100644 (file)
@@ -18,6 +18,8 @@
 #ifndef CRC32C_H
 #define CRC32C_H
 
+#include <inttypes.h>
+
 #include "../arch/arch.h"
 #include "../lib/types.h"
 
index 64fe48a9a432cad8afe96cfc72b88428cec1c43a..ade4f69721c7668a644c3459828ba250992b3d41 100644 (file)
--- 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)
index 75317f76c6f553621862073ed8d5a21dc29e1f32..416199baffa7cbfc0f2098a1e55320a474292a1a 100644 (file)
@@ -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,
index 2fd17a32d16cfdd986a558e562a8d68e5b25b3dd..2b39c42e22deb80365ef6269a44cf82e91e558ee 100644 (file)
@@ -17,7 +17,6 @@
  *
  */
 #include <string.h>
-#include <inttypes.h>
 
 #include "../lib/bswap.h"
 #include "sha256.h"
index b6360336d2f5a0a661627b9d7c0c6b93e19aed9f..b904c7d1d3d031660542565910f024f261fe5f1b 100644 (file)
@@ -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
 
index 2685dce60f66ad17c75341817110e0416938d449..c136550aae21c519ffdd3762d7d210e89e5fc9d6 100644 (file)
@@ -13,7 +13,6 @@
  *
  */
 #include <string.h>
-#include <inttypes.h>
 
 #include "../os/os.h"
 
index e069a4489e5816dfcd817bf1c32fab2d6acb5504..f599cdcc82061bbce70e68f83fde957fc40a741c 100644 (file)
@@ -12,7 +12,6 @@
  */
 
 #include <string.h>
-#include <inttypes.h>
 
 #include "../lib/bswap.h"
 #include "sha512.h"
index f8b2112aedb1ecc50ada88cd13a7e7cc1050295c..5adf6271cd4fbb0aa331a656e64bd653a2b3752f 100644 (file)
@@ -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];
index b119872625864eae504123faa47157ee61984d4e..b57f07a4d718f3b623920528d74cde69740f7820 100644 (file)
@@ -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 2bee5078c12325873e87903c93c3623d4ca1ea76..d1e2987ba3e7c1004487bcacd858ade03944a12a 100644 (file)
--- 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 1765fdb61eb06a6518b2d67f9e4a000592dc55b6..8a8cf8710e04fd70365925b90ec4cf6081ddecae 100644 (file)
--- 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,
index dd8fc6a20b3aec09875823f416369743a897af3e..b973120c1abc89b7bea66698a0b38e47315858f3 100644 (file)
@@ -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
index c1035785c0a883bb1f2d571ad29d2944bf8fd059..15ec681a449c4a9b34929933ab95f1c85b3c1257 100644 (file)
@@ -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"
 
index 4b444888aa9bb51c5a660aee67f385dd6f20c021..3619450d295d15c344616114c491cddddcfcb0f0 100644 (file)
@@ -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"
index 2b00d525d648e071bb17a7e97c0b63405f192ec7..bb3ac85045b2f16fd650abe2c2081371acd6f2c1 100644 (file)
@@ -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"
index 0c3bcdd6b1989e3c331331021cf592e90cd897a2..6fa041cdbaa1421b775b2ecfcf68a479c2d507f0 100644 (file)
@@ -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;
index e86dbac0091ec7e4178b652729fd6bc7b872071f..14e115f221b6434b65771905c24ad89d34cd7c55 100644 (file)
@@ -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)
 {
index e0d7cbbafb780551f35c62c83bb9dd3b26b4b164..7d59df3869f12238d3ebdefc6ae4f85145b9de85 100644 (file)
@@ -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"
index ea7179da2325ece1b0fd7772271d74fff4e90a3e..9dbefc8214dd71d7dc569864d7c571f7391fc5d7 100644 (file)
@@ -7,7 +7,6 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
-#include <unistd.h>
 #include <errno.h>
 #include <sys/mman.h>
 
index b4a660041cf1c9ecf2210e9387aef3e38d9b47da..5f822fc1f52009c9b60aa8cd9bd18fd3d9186f35 100644 (file)
@@ -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;
index 37d44fd803d32ef578dd0a085bc3be7d9d48cd65..9b385b0cf035d0c90dd9640d43a7b274ad8b865f 100644 (file)
@@ -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>
index 0cfc22ad9e04d72ac8b1cc64e0b7fc958a4b2bdf..8c26ad7179aa1589720e7d6e3d4e84e4261d3cc8 100644 (file)
  * 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"
index f240755595052684864209cdc5b6982a805fcc2d..7b18c28ef2cefac49bb313b28c259b493fc01674 100644 (file)
@@ -8,7 +8,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <assert.h>
 #include <sys/poll.h>
 
 #include "../fio.h"
index d5d8ab0ebafdac9cdc1c6ebd3617109f97adc13a..d322f40212f57e21f1bd297a7ef9ed7ea439f0db 100644 (file)
@@ -9,7 +9,6 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <errno.h>
-#include <assert.h>
 #include <sys/poll.h>
 #include <sys/mman.h>
 
index 26b98b60e2c7896e846c6b0daa2a1ad138b8b6fb..d5b4012f80338440068e242fa64f823ae02453cf 100644 (file)
@@ -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 3126f217d490ba27e05abe65394be285354f77a2..2d549ee9c8f4798154a1f3f9e515b6762cab0ebf 100644 (file)
--- 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 98737e9c8305aa00ea6f21e9a08d2af0b1b97e6f..ac0d21576dcf9fce5192945472cb7dd04f624bff 100644 (file)
--- 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 5e3d33967a1a1ffe1e1cecf06fabbde0f4015d06..61cc5a87bd473d939dc3ebe06f46f0cccb0f7fc1 100644 (file)
--- 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 */
index 7cbce1327f8f21edb32159376be406841016ef62..c115f7b16863a88f411427a424be06f3f558e56a 100644 (file)
@@ -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 7b61ffca343a2f2742a92dc31fb53e3440e685c5..f19db1be6f024b0a0420f8a298eca863851a01e4 100644 (file)
--- a/fio.c
+++ b/fio.c
  *  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 9551048745b685bcb1e1b96ac47aeaa0eef56eab..488fa9a62e4e7e10cce59da7517d0a5890bda26f 100644 (file)
--- 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"
index 20fcfccc02eea36c3d6d32cd442d47f34b1bbe95..3b48061cd266cc9f6629a5d52df0dc6e55317f54 100644 (file)
--- 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"
index 8b4bb255f0b483dc4f1ad6f23759ddddaf439a7c..39fb17ba245caee553ccec82924685fee3fc9dda 100644 (file)
@@ -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"
index 87f50600cca01a78d25f53f167d7835212dde5cc..eb535a07cf041250064decdeb1cc9d74f1252703 100644 (file)
@@ -1,5 +1,3 @@
-#include <unistd.h>
-#include <math.h>
 #include <sys/time.h>
 #include <time.h>
 
index 57c66f7e6fbc6a1d8688cbc2d4b6ee0f370c8930..87fc29b50163252e412b85e969aad5de66b7f12b 100644 (file)
--- 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)
index 11e2a7b9c26c0216ee4b2124f6dff929cf50175d..1c4a25c8770c854fb5b43f75069b394b487fe3e9 100644 (file)
--- 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"
 
 /*
index 4342b2d2fa083b0dc5dba021d89d1021a806d39a..a0ee37044e8abdc418ac9f19fcca06509858485a 100644 (file)
--- 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)
index 5f1865bba8129f272edc4afbce9d2e281bc41949..a0b328581f79f3110f15328b7f97d30265e16110 100644 (file)
--- 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);
index 90bc1d9eb09fb7a763dcf567e21062ad2320973d..8762c8565ea8e66116a7e98ed5b544ddc3b1d624 100644 (file)
@@ -1,4 +1,5 @@
 #include <math.h>
+#include "fio.h"
 #include "json.h"
 #include "idletime.h"
 
index b8376c2ce6098cd698d8933604fed7de2f35ff4d..6c1161a7c258d07efb0b41f1be7b9f2ef8d7e53c 100644 (file)
@@ -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 e47e5384119b369891119b54467ed558dfa082c3..ab7e399752dbad7e763a0e727ad4ec4daa1ba7ef 100644 (file)
--- 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 f3b593227043626d6978005c35ebec5c5a6472dc..98a7dc560600ce7c7fc8cfa191e734e5cee29276 100644 (file)
--- 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 da25efb90bfdccb670c7c4a125c59f9f917536fb..aaa7d9723ef68db6bedc9809483a59b3e3efcb39 100644 (file)
--- 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"
index b5b8d2faf3d9ae76cc5ae6a102b6785af47dd5c5..545e2c41fa5f3db673ceb6e4289d43413a1c6bbf 100644 (file)
@@ -2,6 +2,8 @@
 #define FIO_IO_U_QUEUE
 
 #include <assert.h>
+#include <stddef.h>
+
 #include "lib/types.h"
 
 struct io_u;
index 965581aa4157c8594fbc20735a8ac36f438d24b7..a8ec79de473bf235424e9fac80996c112a744364 100644 (file)
@@ -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>
index 32b18edadf1f2dbbdcdf2ae66df3ea264a4a16c8..a0674aeabebfd5cccc49fb2a578b736dbac58054 100644 (file)
@@ -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 460d7a2e51af8ada55d8b324547d6fb1dc12b74b..2b5eaf0c52dac715e971e26915d3015f9c274c2c 100644 (file)
--- 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 70981f99de474cc751767b278a1ac8712066a0c5..f70eb61e6eae92edb324ed5dbea35c9e6dcb11dc 100644 (file)
--- 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 e0227ec6446bdfafe678dee39583109fe461fe7d..75212c85526544c0f1a9a236086e0fd7900f83ce 100644 (file)
--- 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 d7017e0662ce499c8e01e79a761128fe006382f4..bcc712cd4d414b91aeb923ae69c3b9bcd8a4c0b9 100644 (file)
--- 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
index bb81dbbdf8c9b285b1f43f3b339f346a90881a63..f4f9b6b9ee2dfd84e78990f99ddf67aa29e36a2d 100644 (file)
@@ -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"
index f974490f72a512465a2ee3e534031418833da539..1d24e187ab733793fa4ece4dc50c8c15a5efa332 100644 (file)
@@ -1,6 +1,5 @@
 #include <math.h>
 #include <string.h>
-#include <stdio.h>
 #include "../hash.h"
 #include "gauss.h"
 
index c7742a2d295cc1c3d9104fb3161184c2b1ad8298..2154065cc136e2c15c514865baa2d3262e78853a 100644 (file)
@@ -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)
index 0c0072ccb39b15e970eeb6bd92342b67a85cd8bb..a4f1fb13b64f7b1087970bba0e9c58afafd002db 100644 (file)
@@ -1,5 +1,4 @@
 #include <stdio.h>
-#include <math.h>
 
 #include "lfsr.h"
 #include "../compiler/compiler.h"
index bfbd1e80c851da90410dfbf0565849ce725f3193..e774c19c3ebe9980008b38afacc4c29c475ca666 100644 (file)
@@ -1,6 +1,5 @@
-#include <stdlib.h>
 #include <assert.h>
-#include <inttypes.h>
+#include <stdlib.h>
 
 #include "memalign.h"
 
index df412e283a7c51b96f3fc72b9362ce412a83a4f3..c2eb17027d8b10041a73fc069a6f15d93c0328a4 100644 (file)
@@ -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);
 
index 00e65aa7d50a8e915d66935e28633d64bd24c81a..cf8572e270898a14c3fb3daf8be047c3bbcedd1c 100644 (file)
@@ -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
 
index 8d0884132fe4ce5a3f2aace08fe26ef9eb5b28bf..387c5d7b322dc1947d095c9eeed03a8b3fae75a4 100644 (file)
@@ -1,3 +1,4 @@
+#include <assert.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
index f6c304bdf02efdfa6c229bfefdc6043002b72893..beb8a1426a1a1e620fbe783f9e0648a95dd6c181 100644 (file)
@@ -1,4 +1,3 @@
-#include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
 
index a235af20739ecdc0a3c554a522f10946f8ba45ed..389ed5b7bc0a039d20b45ef52672a2c48f8650ba 100644 (file)
@@ -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;
index 31ee4eaf9896246b487cc5cccd4c62fb42b724f1..2024f2e9cf364a2828d24184eecff4e0c19c9ecc 100644 (file)
@@ -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>
 
index 9f937f021662843b5b70122537f2ff2ec5f55a48..2d655ad0d059dbc6bb8bd57069ae11d059a980a6 100644 (file)
@@ -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
index de3fe1c025276bea0f34a5ee10ce8896ec662507..d8e1b89a94038c2df63e2a0f7435f8184ecd2ba0 100644 (file)
@@ -11,6 +11,7 @@
  * 02Feb2004   Initial version
  */
 
+#include <assert.h>
 #include <stdlib.h>
 #include <limits.h>
 
index e1491dbd562d99422b26d2e9d5983dae66d9ebeb..9bd458f1b6c4222e01f888107cedf9e94acf4ccd 100644 (file)
@@ -2,7 +2,6 @@
 #define _LINUX_PRIO_TREE_H
 
 #include <inttypes.h>
-#include "../hash.h"
 
 struct prio_tree_node {
        struct prio_tree_node   *left;
index 3f60a67ab7a9c195260405024d7badba18b0a871..46ffe4fb0c6b9108685254cbe7f110983eb27088 100644 (file)
@@ -34,7 +34,6 @@
 */
 
 #include <string.h>
-#include <assert.h>
 #include "rand.h"
 #include "pattern.h"
 #include "../hash.h"
index bff4a35167cbbfc95dc9258c54b5bbec3f1400e4..8832c73a7687412241dbe3e9bddbdad6ba5c2b2b 100644 (file)
@@ -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)
index 68f5d1b7db3fb29ba2df26211a8c166adac45661..59c090d3dee578b61e14e4b2d88f87ad954160cf 100644 (file)
@@ -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
index 3d535c79d3b371ba1ee150567a307629b8d9d067..1ff8568094dcecc34ad8350b9f364051de756dd5 100644 (file)
@@ -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"
index af2d0e645c1e462df12190d9669bf5ebf18593d9..a4aa163c80bc1dde7ad46e2f8ae85f32935d3456 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <inttypes.h>
 #include "rand.h"
+#include "types.h"
 
 struct zipf_state {
        uint64_t nranges;
index 80159b4d0dbe1a1575550350727829cd7c6249a9..6faf32a4e918158cc19a7196a28098c93e7bb111 100644 (file)
--- 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 7e8b13b31a84c906a09db6fce5044ef8e051fcae..46e5034e3d68d63f229b844a8a4e5ba8bb69c9d1 100644 (file)
--- 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>
index 04dc3be8bfda1b312298591bff312d8d2b39912a..5f0225f71094d4352a61e99eccc12527ff5bd908 100644 (file)
--- 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
index 681052127be67b2db7fbaa6d1bf927f7fdbb0342..45a5b82be4f2789629dd1f5a6d32a7e6c24938de 100644 (file)
--- 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"
index 83a58e27d50718ba91d909795aec5f419440ca2a..59024efc8af9a90bfa3f52e73f02de0c38214a58 100644 (file)
--- 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 *);
index baeace40d42d54e4180a7526ed5d406bdc89581e..720034fe72d5dbf8411ec6edc7d69e98853f0834 100644 (file)
@@ -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
index 7b0fcb516163d29eec0592cb31c867da37b66a09..40e92f820d12b1279e35a94739dde78f16746fa6 100644 (file)
@@ -1,4 +1,5 @@
 #include <stdlib.h>
+
 #include "strndup.h"
 
 #ifndef CONFIG_HAVE_STRNDUP
diff --git a/parse.c b/parse.c
index fdb66115c310d2f60652e37fcd0d410eeaa23dd5..33fcf465ca5b9be90d670004604d6e51008ba27c 100644 (file)
--- 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"
index 65d4484edae5b82fa01db3237ee7ed4ab7391a68..6f85810963e694129656a7640749cb52a0ed04a6 100644 (file)
--- 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;
index d652d31cf8992b5233b21fad77765a2e13426ece..1eee7dcf97252b0f40f40ec9c24aa3f5a69e446a 100644 (file)
--- 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);
index 13995acce07f56c3b396427bb058676889148988..7b1690ada90cc9b8b4a106e82648267221995b61 100644 (file)
--- 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"
index 4b551e3e4be3fd979462371a4c866c349e2bb04e..8df10e6f67fd401defbb99b3e68ab0ab15a9d619 100644 (file)
--- 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 98ab63893900bcc09ba9a5be785dceffa30b1fff..a837ed90252eff2af69beb88e03f1c2c1ba6d72b 100644 (file)
--- 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"
index 2017ca67a896fbaba39e7b9e8a7c24369003d5a1..1e3a546896ad8b1379368019272ba3ab11b6284f 100644 (file)
@@ -2,7 +2,6 @@
 
 #include "fio.h"
 #include "steadystate.h"
-#include "helper_thread.h"
 
 bool steadystate_enabled = false;
 
index 9fd88ee8cec4c2bad0c61e8c68e73b03d9358be5..51472c4698c0cfd72233a62c34cd1226741138a8 100644 (file)
@@ -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);
index a803ce47bf3386308427c8ebf202ed8df8461625..eef464ff2d5bd4a29bf4dbc54ad6f8ed5131e0cd 100644 (file)
--- 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"
index 4cdb38d10d3ec8c53ee265787124b70a76893556..a8a9d6291430296d42f15555db244650e4ecfa14 100644 (file)
@@ -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
index 1b4277c1b9d3c17b20dccb9df16e7092552f4123..37120e1895063e7270c6e48382ad661f33395fc3 100644 (file)
@@ -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"
index 4e9d39c6431eb097271b516d795e5ff0ef492dfc..c379053db61718fca125f0113137a3ca20cbea9c 100644 (file)
@@ -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[])
 {
index 9faec38934945658ac4bc08606c7120e0d8388ac..4fc10ae72d8421e3407d0239d0f96c2257529d59 100644 (file)
@@ -14,7 +14,6 @@
  */
 #include <stdio.h>
 #include <stdlib.h>
-#include <fcntl.h>
 #include <string.h>
 #include <unistd.h>
 
index 4009b62e38c3acdcfe827f54708cba230c640745..abdbafb5991ddb22053a95dc8022ba6cc7df4eff 100644 (file)
@@ -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"
index 1b38a5349ffc727019364f3490ff37171a03880e..1cc3a75390af333d48e5aa094f0c2d5f32ae51c8 100644 (file)
@@ -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 78cf67244efa22534604fd6b6652379457a571a2..bf825db346df0596b63b88f6e755e7b7985965ca 100644 (file)
--- 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 37f5d7c871127a8bf5858a3fda620684a0e8438d..fe8f9fe990d31b02e6391c3a0d1cbd0c1cb51110 100644 (file)
--- 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);
 
index 321e6485e6828ea885ace56b706c2918dcb14ea1..64121a51af97d68e75fefe12dc178f3b3218b0ce 100644 (file)
--- 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
index e35c181a23ea359a895a51cbab1815f279686d0b..0a62b5f7d38d1868e63c47fa493c8324a30e042f 100644 (file)
@@ -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;