summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cconv.c2
-rw-r--r--crc/crc32c.c2
-rw-r--r--crc/xxhash.c10
-rw-r--r--diskutil.c4
-rw-r--r--engines/falloc.c2
-rw-r--r--engines/net.c2
-rw-r--r--engines/rbd.c2
-rw-r--r--filehash.c1
-rw-r--r--gettime.c2
-rw-r--r--idletime.c2
-rw-r--r--init.c12
-rw-r--r--lib/lfsr.c2
-rw-r--r--lib/num2str.c2
-rw-r--r--lib/prio_tree.c2
-rw-r--r--log.c19
-rw-r--r--profiles/tiobench.c2
-rw-r--r--smalloc.c3
-rw-r--r--stat.c5
18 files changed, 32 insertions, 44 deletions
diff --git a/cconv.c b/cconv.c
index 2843a71c..5b9c3be2 100644
--- a/cconv.c
+++ b/cconv.c
@@ -18,7 +18,7 @@ static void string_to_net(uint8_t *dst, const char *src)
dst[0] = '\0';
}
-void free_thread_options_to_cpu(struct thread_options *o)
+static void free_thread_options_to_cpu(struct thread_options *o)
{
free(o->description);
free(o->name);
diff --git a/crc/crc32c.c b/crc/crc32c.c
index b830b9fe..f6fc6887 100644
--- a/crc/crc32c.c
+++ b/crc/crc32c.c
@@ -32,6 +32,8 @@
*/
#include <inttypes.h>
+#include "crc32c.h"
+
/*
* This is the CRC-32C table
* Generated with:
diff --git a/crc/xxhash.c b/crc/xxhash.c
index db7890b0..eedaecb4 100644
--- a/crc/xxhash.c
+++ b/crc/xxhash.c
@@ -148,7 +148,7 @@ typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
//****************************
typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;
-uint32_t XXH_readLE32_align(const uint32_t* ptr, XXH_endianess endian, XXH_alignment align)
+static uint32_t XXH_readLE32_align(const uint32_t* ptr, XXH_endianess endian, XXH_alignment align)
{
if (align==XXH_unaligned)
return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
@@ -156,13 +156,13 @@ uint32_t XXH_readLE32_align(const uint32_t* ptr, XXH_endianess endian, XXH_align
return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
}
-uint32_t XXH_readLE32(const uint32_t* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
+static uint32_t XXH_readLE32(const uint32_t* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
//****************************
// Simple Hash Functions
//****************************
-uint32_t XXH32_endian_align(const void* input, int len, uint32_t seed, XXH_endianess endian, XXH_alignment align)
+static uint32_t XXH32_endian_align(const void* input, int len, uint32_t seed, XXH_endianess endian, XXH_alignment align)
{
const uint8_t *p = (const uint8_t *)input;
const uint8_t * const bEnd = p + len;
@@ -282,7 +282,7 @@ void* XXH32_init (uint32_t seed)
}
-XXH_errorcode XXH32_update_endian (void* state_in, const void* input, int len, XXH_endianess endian)
+static XXH_errorcode XXH32_update_endian (void* state_in, const void* input, int len, XXH_endianess endian)
{
struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
const uint8_t *p = (const uint8_t *)input;
@@ -358,7 +358,7 @@ XXH_errorcode XXH32_update (void* state_in, const void* input, int len)
-uint32_t XXH32_intermediateDigest_endian (void* state_in, XXH_endianess endian)
+static uint32_t XXH32_intermediateDigest_endian (void* state_in, XXH_endianess endian)
{
struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
const uint8_t *p = (const uint8_t *)state->memory;
diff --git a/diskutil.c b/diskutil.c
index bc12b02e..9aa1fa15 100644
--- a/diskutil.c
+++ b/diskutil.c
@@ -652,8 +652,8 @@ void json_array_add_disk_util(struct disk_util_stat *dus,
json_object_add_value_float(obj, "aggr_util", agg->max_util.u.f);
}
-void json_object_add_disk_utils(struct json_object *obj,
- struct flist_head *head)
+static void json_object_add_disk_utils(struct json_object *obj,
+ struct flist_head *head)
{
struct json_array *array = json_create_array();
struct flist_head *entry;
diff --git a/engines/falloc.c b/engines/falloc.c
index 17a901ad..2b00d525 100644
--- a/engines/falloc.c
+++ b/engines/falloc.c
@@ -23,7 +23,7 @@
* generic_open_file is not appropriate because does not allow to perform
* TRIM in to file
*/
-int open_file(struct thread_data *td, struct fio_file *f)
+static int open_file(struct thread_data *td, struct fio_file *f)
{
int from_hash = 0;
diff --git a/engines/net.c b/engines/net.c
index 1df8d063..110e158f 100644
--- a/engines/net.c
+++ b/engines/net.c
@@ -392,7 +392,7 @@ static int fio_netio_send(struct thread_data *td, struct io_u *io_u)
do {
if (is_udp(o)) {
- struct sockaddr *to;
+ const struct sockaddr *to;
socklen_t len;
if (is_ipv6(o)) {
diff --git a/engines/rbd.c b/engines/rbd.c
index 5a4a3e27..9d64efd2 100644
--- a/engines/rbd.c
+++ b/engines/rbd.c
@@ -422,7 +422,7 @@ static int fio_rbd_io_u_init(struct thread_data *td, struct io_u *io_u)
return 0;
}
-struct ioengine_ops ioengine = {
+static struct ioengine_ops ioengine = {
.name = "rbd",
.version = FIO_IOOPS_VERSION,
.setup = fio_rbd_setup,
diff --git a/filehash.c b/filehash.c
index 2d9659c5..c6ebe761 100644
--- a/filehash.c
+++ b/filehash.c
@@ -4,6 +4,7 @@
#include "fio.h"
#include "flist.h"
#include "hash.h"
+#include "filehash.h"
#define HASH_BUCKETS 512
#define HASH_MASK (HASH_BUCKETS - 1)
diff --git a/gettime.c b/gettime.c
index 8991703f..b89cd46f 100644
--- a/gettime.c
+++ b/gettime.c
@@ -32,7 +32,7 @@ static pthread_key_t tv_tls_key;
enum fio_cs fio_clock_source = FIO_PREFERRED_CLOCK_SOURCE;
int fio_clock_source_set = 0;
-enum fio_cs fio_clock_source_inited = CS_INVAL;
+static enum fio_cs fio_clock_source_inited = CS_INVAL;
#ifdef FIO_DEBUG_TIME
diff --git a/idletime.c b/idletime.c
index 9e696070..c0bc0bfc 100644
--- a/idletime.c
+++ b/idletime.c
@@ -379,7 +379,7 @@ static double fio_idle_prof_cpu_stat(int cpu)
return p * 100.0;
}
-void fio_idle_prof_cleanup(void)
+static void fio_idle_prof_cleanup(void)
{
if (ipc.ipts) {
free(ipc.ipts);
diff --git a/init.c b/init.c
index c7e056fa..c3996a76 100644
--- a/init.c
+++ b/init.c
@@ -28,6 +28,8 @@
#include "lib/getopt.h"
#include "lib/strcasestr.h"
+#include "crc/test.h"
+
const char fio_version_string[] = FIO_VERSION;
#define FIO_RANDSEED (0xb1899bedUL)
@@ -40,6 +42,8 @@ static int parse_only;
static struct thread_data def_thread;
struct thread_data *threads = NULL;
+static char **job_sections;
+static int nr_job_sections;
int exitall_on_terminate = 0;
int output_format = FIO_OUTPUT_NORMAL;
@@ -48,8 +52,6 @@ int eta_print = FIO_ETA_AUTO;
int eta_new_line = 0;
FILE *f_out = NULL;
FILE *f_err = NULL;
-char **job_sections = NULL;
-int nr_job_sections = 0;
char *exec_profile = NULL;
int warnings_fatal = 0;
int terse_version = 3;
@@ -247,7 +249,7 @@ void free_threads_shm(void)
}
}
-void free_shm(void)
+static void free_shm(void)
{
if (threads) {
file_hash_exit();
@@ -1658,13 +1660,11 @@ static int client_flag_set(char c)
return 0;
}
-void parse_cmd_client(void *client, char *opt)
+static void parse_cmd_client(void *client, char *opt)
{
fio_client_add_cmd_option(client, opt);
}
-extern int fio_crctest(const char *);
-
int parse_cmd_line(int argc, char *argv[], int client_type)
{
struct thread_data *td = NULL;
diff --git a/lib/lfsr.c b/lib/lfsr.c
index 9771318a..329ef85a 100644
--- a/lib/lfsr.c
+++ b/lib/lfsr.c
@@ -186,7 +186,7 @@ static uint8_t *find_lfsr(uint64_t size)
* Thus, [1] is equivalent to (y * i) % (spin + 1) == 0;
* Also, the cycle's length will be (x * i) + (y * i) / (spin + 1)
*/
-int prepare_spin(struct fio_lfsr *fl, unsigned int spin)
+static int prepare_spin(struct fio_lfsr *fl, unsigned int spin)
{
uint64_t max = (fl->cached_bit << 1) - 1;
uint64_t x, y;
diff --git a/lib/num2str.c b/lib/num2str.c
index a1041926..12d6f39a 100644
--- a/lib/num2str.c
+++ b/lib/num2str.c
@@ -2,6 +2,8 @@
#include <stdio.h>
#include <string.h>
+#include "../fio.h"
+
/*
* Cheesy number->string conversion, complete with carry rounding error.
*/
diff --git a/lib/prio_tree.c b/lib/prio_tree.c
index b0e935cd..e18ae324 100644
--- a/lib/prio_tree.c
+++ b/lib/prio_tree.c
@@ -49,7 +49,7 @@ static void get_index(const struct prio_tree_node *node,
static unsigned long index_bits_to_maxindex[BITS_PER_LONG];
-void fio_init prio_tree_init(void)
+static void fio_init prio_tree_init(void)
{
unsigned int i;
diff --git a/log.c b/log.c
index a05a7ec5..c4a3b520 100644
--- a/log.c
+++ b/log.c
@@ -34,25 +34,6 @@ int log_local_buf(const char *buf, size_t len)
return len;
}
-int log_local(const char *format, ...)
-{
- char buffer[1024];
- va_list args;
- size_t len;
-
- va_start(args, format);
- len = vsnprintf(buffer, sizeof(buffer), format, args);
- va_end(args);
- len = min(len, sizeof(buffer) - 1);
-
- if (log_syslog)
- syslog(LOG_INFO, "%s", buffer);
- else
- len = fwrite(buffer, len, 1, f_out);
-
- return len;
-}
-
int log_info(const char *format, ...)
{
char buffer[1024];
diff --git a/profiles/tiobench.c b/profiles/tiobench.c
index 7a7030af..b4331d75 100644
--- a/profiles/tiobench.c
+++ b/profiles/tiobench.c
@@ -8,7 +8,7 @@ static unsigned int bs = 4096;
static unsigned int nthreads = 1;
static char *dir;
-char sz_idx[80], bs_idx[80], loop_idx[80], dir_idx[80], t_idx[80];
+static char sz_idx[80], bs_idx[80], loop_idx[80], dir_idx[80], t_idx[80];
static const char *tb_opts[] = {
"buffered=0", sz_idx, bs_idx, loop_idx, dir_idx, t_idx,
diff --git a/smalloc.c b/smalloc.c
index 5dae7e7c..c8f1642e 100644
--- a/smalloc.c
+++ b/smalloc.c
@@ -16,6 +16,7 @@
#include "mutex.h"
#include "arch/arch.h"
#include "os/os.h"
+#include "smalloc.h"
#define SMALLOC_REDZONE /* define to detect memory corruption */
@@ -30,7 +31,7 @@
#define SMALLOC_POST_RED 0x5aa55aa5U
unsigned int smalloc_pool_size = INITIAL_SIZE;
-const int int_mask = sizeof(int) - 1;
+static const int int_mask = sizeof(int) - 1;
struct pool {
struct fio_mutex *lock; /* protects this pool */
diff --git a/stat.c b/stat.c
index f84ce530..4529f694 100644
--- a/stat.c
+++ b/stat.c
@@ -497,7 +497,8 @@ static void show_latencies(struct thread_stat *ts)
show_lat_m(io_u_lat_m);
}
-void show_thread_status_normal(struct thread_stat *ts, struct group_run_stats *rs)
+static void show_thread_status_normal(struct thread_stat *ts,
+ struct group_run_stats *rs)
{
double usr_cpu, sys_cpu;
unsigned long runtime;
@@ -1012,7 +1013,7 @@ struct json_object *show_thread_status(struct thread_stat *ts,
if (output_format == FIO_OUTPUT_TERSE)
show_thread_status_terse(ts, rs);
else if (output_format == FIO_OUTPUT_JSON)
- return(show_thread_status_json(ts, rs));
+ return show_thread_status_json(ts, rs);
else
show_thread_status_normal(ts, rs);
return NULL;