diff options
author | Sitsofe Wheeler <sitsofe@yahoo.com> | 2018-03-19 05:33:13 +0000 |
---|---|---|
committer | Sitsofe Wheeler <sitsofe@yahoo.com> | 2018-03-21 22:09:28 +0000 |
commit | 3d2d14bcb844e72809192311369a642c5d415472 (patch) | |
tree | 122bf381752fe506a9db265c5199178261a6ab9f | |
parent | 0f0346e0c8f9141ceea8a5de8264c635ea0cae9b (diff) | |
download | fio-3d2d14bcb844e72809192311369a642c5d415472.tar.gz fio-3d2d14bcb844e72809192311369a642c5d415472.tar.bz2 |
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.c | 12 | ||||
-rw-r--r-- | blktrace.c | 2 | ||||
-rw-r--r-- | cconv.c | 1 | ||||
-rw-r--r-- | cgroup.c | 1 | ||||
-rw-r--r-- | client.c | 4 | ||||
-rw-r--r-- | client.h | 6 | ||||
-rw-r--r-- | compiler/compiler.h | 1 | ||||
-rw-r--r-- | crc/crc32.c | 1 | ||||
-rw-r--r-- | crc/crc32.h | 2 | ||||
-rw-r--r-- | crc/crc32c-intel.c | 7 | ||||
-rw-r--r-- | crc/crc32c.c | 2 | ||||
-rw-r--r-- | crc/crc32c.h | 2 | ||||
-rw-r--r-- | crc/md5.c | 1 | ||||
-rw-r--r-- | crc/sha1.h | 2 | ||||
-rw-r--r-- | crc/sha256.c | 1 | ||||
-rw-r--r-- | crc/sha256.h | 2 | ||||
-rw-r--r-- | crc/sha3.c | 1 | ||||
-rw-r--r-- | crc/sha512.c | 1 | ||||
-rw-r--r-- | crc/sha512.h | 2 | ||||
-rw-r--r-- | crc/test.c | 5 | ||||
-rw-r--r-- | debug.c | 5 | ||||
-rw-r--r-- | debug.h | 2 | ||||
-rw-r--r-- | diskutil.c | 3 | ||||
-rw-r--r-- | diskutil.h | 1 | ||||
-rw-r--r-- | engines/e4defrag.c | 4 | ||||
-rw-r--r-- | engines/falloc.c | 4 | ||||
-rw-r--r-- | engines/filecreate.c | 2 | ||||
-rw-r--r-- | engines/ftruncate.c | 8 | ||||
-rw-r--r-- | engines/libaio.c | 2 | ||||
-rw-r--r-- | engines/mmap.c | 1 | ||||
-rw-r--r-- | engines/mtd.c | 3 | ||||
-rw-r--r-- | engines/net.c | 2 | ||||
-rw-r--r-- | engines/null.c | 3 | ||||
-rw-r--r-- | engines/sg.c | 1 | ||||
-rw-r--r-- | engines/splice.c | 1 | ||||
-rw-r--r-- | engines/sync.c | 1 | ||||
-rw-r--r-- | eta.c | 1 | ||||
-rw-r--r-- | fifo.c | 1 | ||||
-rw-r--r-- | fifo.h | 1 | ||||
-rw-r--r-- | filesetup.c | 2 | ||||
-rw-r--r-- | fio.c | 5 | ||||
-rw-r--r-- | fio.h | 1 | ||||
-rw-r--r-- | fio_sem.c | 2 | ||||
-rw-r--r-- | fio_time.h | 1 | ||||
-rw-r--r-- | gettime-thread.c | 2 | ||||
-rw-r--r-- | gettime.c | 7 | ||||
-rw-r--r-- | gettime.h | 2 | ||||
-rw-r--r-- | helpers.c | 9 | ||||
-rw-r--r-- | helpers.h | 5 | ||||
-rw-r--r-- | idletime.c | 1 | ||||
-rw-r--r-- | idletime.h | 5 | ||||
-rw-r--r-- | init.c | 2 | ||||
-rw-r--r-- | io_u.c | 4 | ||||
-rw-r--r-- | io_u.h | 1 | ||||
-rw-r--r-- | io_u_queue.h | 2 | ||||
-rw-r--r-- | ioengines.c | 1 | ||||
-rw-r--r-- | ioengines.h | 5 | ||||
-rw-r--r-- | iolog.c | 2 | ||||
-rw-r--r-- | iolog.h | 2 | ||||
-rw-r--r-- | json.c | 1 | ||||
-rw-r--r-- | json.h | 4 | ||||
-rw-r--r-- | lib/bloom.c | 2 | ||||
-rw-r--r-- | lib/gauss.c | 1 | ||||
-rw-r--r-- | lib/ieee754.c | 1 | ||||
-rw-r--r-- | lib/lfsr.c | 1 | ||||
-rw-r--r-- | lib/memalign.c | 3 | ||||
-rw-r--r-- | lib/memalign.h | 2 | ||||
-rw-r--r-- | lib/memcpy.c | 3 | ||||
-rw-r--r-- | lib/num2str.c | 1 | ||||
-rw-r--r-- | lib/output_buffer.c | 1 | ||||
-rw-r--r-- | lib/output_buffer.h | 2 | ||||
-rw-r--r-- | lib/pattern.c | 2 | ||||
-rw-r--r-- | lib/pattern.h | 2 | ||||
-rw-r--r-- | lib/prio_tree.c | 1 | ||||
-rw-r--r-- | lib/prio_tree.h | 1 | ||||
-rw-r--r-- | lib/rand.c | 1 | ||||
-rw-r--r-- | lib/rand.h | 1 | ||||
-rw-r--r-- | lib/strntol.h | 2 | ||||
-rw-r--r-- | lib/zipf.c | 6 | ||||
-rw-r--r-- | lib/zipf.h | 1 | ||||
-rw-r--r-- | libfio.c | 1 | ||||
-rw-r--r-- | log.c | 1 | ||||
-rw-r--r-- | memory.c | 3 | ||||
-rw-r--r-- | options.c | 4 | ||||
-rw-r--r-- | options.h | 1 | ||||
-rw-r--r-- | oslib/strlcat.h | 2 | ||||
-rw-r--r-- | oslib/strndup.c | 1 | ||||
-rw-r--r-- | parse.c | 4 | ||||
-rw-r--r-- | server.c | 4 | ||||
-rw-r--r-- | server.h | 3 | ||||
-rw-r--r-- | smalloc.c | 8 | ||||
-rw-r--r-- | smalloc.h | 2 | ||||
-rw-r--r-- | stat.c | 3 | ||||
-rw-r--r-- | steadystate.c | 1 | ||||
-rw-r--r-- | steadystate.h | 2 | ||||
-rw-r--r-- | t/axmap.c | 3 | ||||
-rw-r--r-- | t/btrace2fio.c | 2 | ||||
-rw-r--r-- | t/dedupe.c | 10 | ||||
-rw-r--r-- | t/gen-rand.c | 12 | ||||
-rw-r--r-- | t/genzipf.c | 1 | ||||
-rw-r--r-- | t/lfsr-test.c | 4 | ||||
-rw-r--r-- | td_error.h | 2 | ||||
-rw-r--r-- | trim.c | 3 | ||||
-rw-r--r-- | trim.h | 8 | ||||
-rw-r--r-- | verify.h | 1 | ||||
-rw-r--r-- | workqueue.h | 7 |
106 files changed, 83 insertions, 212 deletions
@@ -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" @@ -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" @@ -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) @@ -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" @@ -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); @@ -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 91a98836..8488aa0d 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 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 <inttypes.h> #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 <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 05a087dc..9a2cefde 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 f6fc6887..34944aea 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 be03c1a2..60f60141 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" @@ -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) @@ -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 2fd17a32..2b39c42e 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 b6360336..b904c7d1 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 @@ -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 e069a448..f599cdcc 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 f8b2112a..5adf6271 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]; @@ -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" @@ -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, ...) @@ -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, @@ -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 @@ -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 <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 2b00d525..bb3ac850 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 0c3bcdd6..6fa041cd 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 e86dbac0..14e115f2 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 e0d7cbba..7d59df38 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 ea7179da..9dbefc82 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 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 <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 37d44fd8..9b385b0c 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 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 <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 f2407555..7b18c28e 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 d5d8ab0e..d322f402 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 26b98b60..d5b4012f 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" @@ -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> @@ -24,6 +24,7 @@ #include <string.h> #include "fifo.h" +#include "minmax.h" struct fifo *fifo_alloc(unsigned int size) { @@ -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 <dirent.h> #include <libgen.h> #include <sys/stat.h> -#include <sys/mman.h> -#include <sys/types.h> #include "fio.h" #include "smalloc.h" @@ -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[]) { @@ -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" @@ -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" @@ -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 87f50600..eb535a07 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> @@ -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) @@ -1,6 +1,8 @@ #ifndef FIO_GETTIME_H #define FIO_GETTIME_H +#include <sys/time.h> + #include "arch/arch.h" /* @@ -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) @@ -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); @@ -1,4 +1,5 @@ #include <math.h> +#include "fio.h" #include "json.h" #include "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 @@ -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> @@ -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" @@ -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 <assert.h> +#include <stddef.h> + #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 <stdio.h> #include <stdlib.h> #include <unistd.h> #include <string.h> 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 <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 @@ -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" @@ -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" @@ -1,6 +1,5 @@ #include <stdlib.h> #include <string.h> -#include <stdio.h> #include <errno.h> #include <stdarg.h> #include "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 <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 f974490f..1d24e187 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 c7742a2d..2154065c 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) @@ -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 bfbd1e80..e774c19c 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 df412e28..c2eb1702 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 00e65aa7..cf8572e2 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 8d088413..387c5d7b 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 f6c304bd..beb8a142 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 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 <unistd.h> +#include <stddef.h> 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 <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 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 <assert.h> #include <stdlib.h> #include <limits.h> 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 <inttypes.h> -#include "../hash.h" struct prio_tree_node { struct prio_tree_node *left; @@ -34,7 +34,6 @@ */ #include <string.h> -#include <assert.h> #include "rand.h" #include "pattern.h" #include "../hash.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 68f5d1b7..59c090d3 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 @@ -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" @@ -3,6 +3,7 @@ #include <inttypes.h> #include "rand.h" +#include "types.h" struct zipf_state { uint64_t nranges; @@ -23,7 +23,6 @@ */ #include <string.h> -#include <sys/types.h> #include <signal.h> #include <stdint.h> #include <locale.h> @@ -1,5 +1,4 @@ #include <unistd.h> -#include <fcntl.h> #include <string.h> #include <stdarg.h> #include <syslog.h> @@ -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 @@ -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" @@ -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 baeace40..720034fe 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 7b0fcb51..40e92f82 100644 --- a/oslib/strndup.c +++ b/oslib/strndup.c @@ -1,4 +1,5 @@ #include <stdlib.h> + #include "strndup.h" #ifndef CONFIG_HAVE_STRNDUP @@ -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" @@ -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; @@ -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); @@ -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" @@ -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 *); @@ -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 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); @@ -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 4cdb38d1..a8a9d629 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 @@ -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 4e9d39c6..c379053d 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 9faec389..4fc10ae7 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 4009b62e..abdbafb5 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" @@ -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. @@ -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" @@ -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); @@ -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 e35c181a..0a62b5f7 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; |