Fix Runtime, IOPS, bandwidth recorded incorrectly
[fio.git] / lib / rand.h
index f80c111a53f9083d19ad0c972920732cb7a51bef..089837dbf0267c326dc4b355782558c24080abf1 100644 (file)
@@ -7,7 +7,13 @@ struct frand_state {
        unsigned int s1, s2, s3;
 };
 
-extern struct frand_state __fio_rand_state;
+static inline void frand_copy(struct frand_state *dst,
+                             struct frand_state *src)
+{
+       dst->s1 = src->s1;
+       dst->s2 = src->s2;
+       dst->s3 = src->s3;
+}
 
 static inline unsigned int __rand(struct frand_state *state)
 {
@@ -23,6 +29,9 @@ static inline unsigned int __rand(struct frand_state *state)
 extern void init_rand(struct frand_state *);
 extern void init_rand_seed(struct frand_state *, unsigned int seed);
 extern void __fill_random_buf(void *buf, unsigned int len, unsigned long seed);
-extern unsigned long fill_random_buf(void *buf, unsigned int len);
+extern unsigned long fill_random_buf(struct frand_state *, void *buf, unsigned int len);
+extern void __fill_random_buf_percentage(unsigned long, void *, unsigned int, unsigned int, unsigned int, char *, unsigned int);
+extern unsigned long fill_random_buf_percentage(struct frand_state *, void *, unsigned int, unsigned int, unsigned int, char *, unsigned int);
+extern void fill_pattern(void *p, unsigned int len, char *pattern, unsigned int pattern_bytes);
 
 #endif