[PATCH] Warn on writable strings
[fio.git] / fio.h
diff --git a/fio.h b/fio.h
index 6a68ec8dc674b0af8b074faba0627ef9940e82ab..434c34b237ed718cb1c8312fc77629281d35c39f 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -10,6 +10,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <unistd.h>
+#include <string.h>
 
 #include "list.h"
 #include "md5.h"
@@ -205,9 +206,10 @@ struct thread_data {
        unsigned int norandommap;
        unsigned int bs_unaligned;
 
-       unsigned int bs;
-       unsigned int min_bs;
-       unsigned int max_bs;
+       unsigned int bs[2];
+       unsigned int min_bs[2];
+       unsigned int max_bs[2];
+       unsigned int rw_min_bs;
        unsigned int thinktime;
        unsigned int fsync_blocks;
        unsigned int start_delay;
@@ -354,7 +356,7 @@ extern int groupid;
 extern int terse_output;
 extern FILE *f_out;
 extern FILE *f_err;
-extern char *fio_inst_prefix;
+extern const char *fio_inst_prefix;
 extern int temp_stall_ts;
 
 extern struct thread_data *threads;
@@ -364,7 +366,7 @@ extern struct thread_data *threads;
 #define td_rw(td)              ((td)->iomix != 0)
 
 #define BLOCKS_PER_MAP         (8 * sizeof(long))
-#define TO_MAP_BLOCK(td, f, b) ((b) - ((f)->file_offset / (td)->min_bs))
+#define TO_MAP_BLOCK(td, f, b) ((b) - ((f)->file_offset / (td)->rw_min_bs))
 #define RAND_MAP_IDX(td, f, b) (TO_MAP_BLOCK(td, f, b) / BLOCKS_PER_MAP)
 #define RAND_MAP_BIT(td, f, b) (TO_MAP_BLOCK(td, f, b) & (BLOCKS_PER_MAP - 1))
 
@@ -417,6 +419,9 @@ struct io_completion_data {
 #ifndef min
 #define min(a, b)      ((a) < (b) ? (a) : (b))
 #endif
+#ifndef max
+#define max(a, b)      ((a) > (b) ? (a) : (b))
+#endif
 
 /*
  * Log exports
@@ -454,7 +459,8 @@ extern unsigned long time_since_now(struct timeval *);
 extern unsigned long mtime_since_genesis(void);
 extern void __usec_sleep(unsigned int);
 extern void usec_sleep(struct thread_data *, unsigned long);
-extern void rate_throttle(struct thread_data *, unsigned long, unsigned int);
+extern void rate_throttle(struct thread_data *, unsigned long, unsigned int, int);
+extern void fill_start_time(struct timeval *);
 
 /*
  * Init functions