Merge branch 'master' into gfio
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index cafc93ae54115db57df57f929f1ec094287bf222..8246e38856a22321fae6bcab9410ed401f64cabd 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -20,7 +20,7 @@ struct thread_data;
 #include "thread_options.h"
 #include "flist.h"
 #include "fifo.h"
-#include "rbtree.h"
+#include "lib/rbtree.h"
 #include "arch/arch.h"
 #include "os/os.h"
 #include "mutex.h"
@@ -66,10 +66,12 @@ struct thread_data {
        void *eo;
        char verror[FIO_VERROR_SIZE];
        pthread_t thread;
-       int thread_number;
-       int groupid;
+       unsigned int thread_number;
+       unsigned int groupid;
        struct thread_stat ts;
 
+       int client_type;
+
        struct io_log *slat_log;
        struct io_log *clat_log;
        struct io_log *lat_log;
@@ -97,18 +99,16 @@ struct thread_data {
                struct frand_state __next_file_state;
        };
        int error;
+       int sig;
        int done;
        pid_t pid;
        char *orig_buffer;
        size_t orig_buffer_size;
        volatile int terminate;
        volatile int runstate;
-       unsigned int ioprio;
-       unsigned int ioprio_set;
        unsigned int last_was_sync;
        enum fio_ddir last_ddir;
 
-       char *mmapfile;
        int mmapfd;
 
        void *iolog_buf;
@@ -274,6 +274,8 @@ struct thread_data {
         */
        struct prof_io_ops prof_io_ops;
        void *prof_data;
+
+       void *pinned_mem;
 };
 
 /*
@@ -308,12 +310,10 @@ enum {
 
 extern int exitall_on_terminate;
 extern unsigned int thread_number;
-extern unsigned int nr_process, nr_thread;
 extern int shm_id;
 extern int groupid;
 extern int terse_output;
 extern int temp_stall_ts;
-extern unsigned long long mlock_size;
 extern unsigned long page_mask, page_size;
 extern int read_only;
 extern int eta_print;
@@ -379,8 +379,8 @@ static inline int should_fsync(struct thread_data *td)
  */
 extern int __must_check fio_init_options(void);
 extern int __must_check parse_options(int, char **);
-extern int parse_jobs_ini(char *, int, int);
-extern int parse_cmd_line(int, char **);
+extern int parse_jobs_ini(char *, int, int, int);
+extern int parse_cmd_line(int, char **, int);
 extern int fio_backend(void);
 extern void reset_fio_state(void);
 extern void clear_io_state(struct thread_data *);
@@ -395,7 +395,7 @@ extern void fio_options_dup_and_init(struct option *);
 extern void fio_options_mem_dupe(struct thread_data *);
 extern void options_mem_dupe(void *data, struct fio_option *options);
 extern void td_fill_rand_seeds(struct thread_data *);
-extern void add_job_opts(const char **);
+extern void add_job_opts(const char **, int);
 extern char *num2str(unsigned long, int, int, int);
 extern int ioengine_load(struct thread_data *);
 
@@ -412,6 +412,7 @@ extern int initialize_fio(char *envp[]);
  */
 extern void print_thread_status(void);
 extern void print_status_init(int);
+extern char *fio_uint_to_kmg(unsigned int val);
 
 /*
  * Thread life cycle. Once a thread has a runstate beyond TD_INITIALIZED, it
@@ -439,10 +440,11 @@ extern void fio_terminate_threads(int);
 /*
  * Memory helpers
  */
-extern int __must_check fio_pin_memory(void);
-extern void fio_unpin_memory(void);
+extern int __must_check fio_pin_memory(struct thread_data *);
+extern void fio_unpin_memory(struct thread_data *);
 extern int __must_check allocate_io_mem(struct thread_data *);
 extern void free_io_mem(struct thread_data *);
+extern void free_threads_shm(void);
 
 /*
  * Reset stats after ramp time completes
@@ -549,4 +551,6 @@ static inline void td_io_u_free_notify(struct thread_data *td)
 extern const char *fio_get_arch_string(int);
 extern const char *fio_get_os_string(int);
 
+#define ARRAY_SIZE(x) (sizeof((x)) / (sizeof((x)[0])))
+
 #endif