projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rand: cleanup rand_between() and helpers
[fio.git]
/
io_u.c
diff --git
a/io_u.c
b/io_u.c
index 945aa19288bdc333c0d7a5e6087c54813ea420d3..580c414622db161fe78061413ac5bef6de7e0efb 100644
(file)
--- a/
io_u.c
+++ b/
io_u.c
@@
-168,7
+168,7
@@
bail:
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
- v = rand
32
_between(&td->zone_state, 1, 100);
+ v = rand_between(&td->zone_state, 1, 100);
/*
* Find our generated table. 'send' is the end block of this zone,
/*
* Find our generated table. 'send' is the end block of this zone,
@@
-225,7
+225,7
@@
bail:
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
/*
* Generate a value, v, between 1 and 100, both inclusive
*/
- v = rand
32
_between(&td->zone_state, 1, 100);
+ v = rand_between(&td->zone_state, 1, 100);
zsi = &td->zone_state_index[ddir][v - 1];
stotal = zsi->size_perc_prev;
zsi = &td->zone_state_index[ddir][v - 1];
stotal = zsi->size_perc_prev;
@@
-300,7
+300,7
@@
static bool should_do_random(struct thread_data *td, enum fio_ddir ddir)
if (td->o.perc_rand[ddir] == 100)
return true;
if (td->o.perc_rand[ddir] == 100)
return true;
- v = rand
32
_between(&td->seq_rand_state[ddir], 1, 100);
+ v = rand_between(&td->seq_rand_state[ddir], 1, 100);
return v <= td->o.perc_rand[ddir];
}
return v <= td->o.perc_rand[ddir];
}
@@
-589,7
+589,7
@@
static inline enum fio_ddir get_rand_ddir(struct thread_data *td)
{
unsigned int v;
{
unsigned int v;
- v = rand
32
_between(&td->rwmix_state, 1, 100);
+ v = rand_between(&td->rwmix_state, 1, 100);
if (v <= td->o.rwmix[DDIR_READ])
return DDIR_READ;
if (v <= td->o.rwmix[DDIR_READ])
return DDIR_READ;
@@
-2069,7
+2069,7
@@
static struct frand_state *get_buf_state(struct thread_data *td)
return &td->buf_state;
}
return &td->buf_state;
}
- v = rand
32
_between(&td->dedupe_state, 1, 100);
+ v = rand_between(&td->dedupe_state, 1, 100);
if (v <= td->o.dedupe_percentage)
return &td->buf_state_prev;
if (v <= td->o.dedupe_percentage)
return &td->buf_state_prev;