X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=lib%2Frand.h;h=8c35ab1fa2636655ca17cd0f868b8c2ffafd0336;hp=6b9e13c03acd77895d1fbe32e2dd88de10cbfa26;hb=5c94b00876437a27f1761e47437166780c3c3b93;hpb=3545a109a2cfe5ab22969ef453dc049db47f0b68 diff --git a/lib/rand.h b/lib/rand.h index 6b9e13c0..8c35ab1f 100644 --- a/lib/rand.h +++ b/lib/rand.h @@ -7,6 +7,14 @@ struct frand_state { unsigned int s1, s2, s3; }; +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) { #define TAUSWORTHE(s,a,b,c,d) ((s&c)<>b) @@ -22,5 +30,6 @@ 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(struct frand_state *, void *buf, unsigned int len); +extern unsigned long fill_random_buf_percentage(struct frand_state *, void *buf, unsigned int percentage, unsigned int segment, unsigned int len); #endif