static sem_t startup_sem;
-void sig_handler(int sig)
+static void sig_handler(int sig)
{
int i;
}
}
-int init_random_state(struct thread_data *td)
+static int init_random_state(struct thread_data *td)
{
unsigned long seed = 123;
return 0;
}
-void shutdown_stat_file(struct thread_data *td)
+static void shutdown_stat_file(struct thread_data *td)
{
if (td->stat_fd != -1) {
fsync(td->stat_fd);
}
}
-int init_stat_file(struct thread_data *td)
+static int init_stat_file(struct thread_data *td)
{
char n[256];
return 0;
}
-unsigned long utime_since(struct timeval *s, struct timeval *e)
+static unsigned long utime_since(struct timeval *s, struct timeval *e)
{
double sec, usec;
return sec + usec;
}
-unsigned long mtime_since(struct timeval *s, struct timeval *e)
+static unsigned long mtime_since(struct timeval *s, struct timeval *e)
{
double sec, usec;
return sec + usec;
}
-unsigned long time_since(struct timeval *s, struct timeval *e)
-{
- double sec, usec, ret;
-
- sec = e->tv_sec - s->tv_sec;
- usec = e->tv_usec - s->tv_usec;
- if (sec > 0 && usec < 0) {
- sec--;
- usec += 1000000;
- }
-
- ret = sec + usec / (double) 1000000;
- if (ret < 0)
- ret = 0;
-
- return (unsigned long) ret;
-}
-
-unsigned long get_next_offset(struct thread_data *td)
+static unsigned long get_next_offset(struct thread_data *td)
{
unsigned long b;
long r;
return b * td->bs;
}
-void add_stat_sample(struct thread_data *td, unsigned long msec)
+static void add_stat_sample(struct thread_data *td, unsigned long msec)
{
char sample[256];
#endif
}
-void usec_sleep(int usec)
+static void usec_sleep(int usec)
{
struct timespec req = { .tv_sec = 0, .tv_nsec = usec * 1000 };
struct timespec rem;
} while (1);
}
-void rate_throttle(struct thread_data *td, unsigned long time_spent)
+static void rate_throttle(struct thread_data *td, unsigned long time_spent)
{
if (!td->rate)
return;
}
}
-int check_min_rate(struct thread_data *td, struct timeval *now)
+static int check_min_rate(struct thread_data *td, struct timeval *now)
{
unsigned long spent = mtime_since(&td->start, now);
unsigned long rate;
#define should_fsync(td) ((td)->ddir == DDIR_WRITE && !(td)->odirect)
-void do_thread_io(struct thread_data *td)
+static void do_thread_io(struct thread_data *td)
{
struct timeval s, e;
char *buffer, *ptr;
free(ptr);
}
-void *thread_main(int shm_id, int offset, char *argv[])
+static void *thread_main(int shm_id, int offset, char *argv[])
{
struct thread_data *td;
void *data;
return NULL;
}
-void free_shm(void)
+static void free_shm(void)
{
shmdt(threads);
}
-void show_thread_status(struct thread_data *td)
+static void show_thread_status(struct thread_data *td)
{
int prio, prio_class;
unsigned long bw = 0;
printf("thread%d (%s): err=%2d, prio=%1d/%1d maxl=%5lumsec, io=%6luMiB, bw=%6luKiB/sec\n", td->thread_number, td->ddir == DDIR_READ ? " read": "write", td->error, prio_class, prio, td->max_latency, td->io_blocks * td->bs >> 20, bw);
}
-void usage(char *progname)
-{
- printf("%s: <-s 0/1> <-b kb> <-t sec> <-w 0/1> <-c r,w,r...> file0... fileN\n", progname);
-}
-
-int setup_rate(struct thread_data *td)
+static int setup_rate(struct thread_data *td)
{
int nr_reads_per_sec;
return 0;
}
-struct thread_data *get_new_job(void)
+static struct thread_data *get_new_job(void)
{
struct thread_data *td;
thread_number--;
}
-int add_job(struct thread_data *td, const char *filename, int prioclass,
- int prio)
+static int add_job(struct thread_data *td, const char *filename, int prioclass,
+ int prio)
{
strcpy(td->file_name, filename);
td->stat_fd = -1;
}
}
-void fill_option(const char *input, char *output)
+static void fill_option(const char *input, char *output)
{
int i;
* rw=
* direct=
*/
-void parse_jobs_cmd(int argc, char *argv[], int index)
+static void parse_jobs_cmd(int argc, char *argv[], int index)
{
struct thread_data *td;
unsigned int prio, prioclass, cpu;
free(filename);
}
-int check_int(char *p, char *name, unsigned int *val)
+static int check_int(char *p, char *name, unsigned int *val)
{
char str[128];
return 1;
}
-int is_empty(char *line)
+static int is_empty(char *line)
{
unsigned int i;
return 1;
}
-int parse_jobs_ini(char *file)
+static int parse_jobs_ini(char *file)
{
unsigned int prioclass, prio, cpu;
struct thread_data *td;
return 0;
}
-int parse_options(int argc, char *argv[])
+static int parse_options(int argc, char *argv[])
{
int i;