diff options
author | Jens Axboe <axboe@kernel.dk> | 2021-07-15 09:54:03 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-07-15 09:54:03 -0600 |
commit | ae5c7cdd710dfa97705d965dcf001a96504e5f31 (patch) | |
tree | af6159f11a6d31c1373884b83878e822a4f286b4 /lib/rand.c | |
parent | aaedde68bfb2d15c3a444df496ba26ac0956445c (diff) | |
parent | 0d71aa983a4dce75a088b3a4831d5b217df066fb (diff) | |
download | fio-ae5c7cdd710dfa97705d965dcf001a96504e5f31.tar.gz fio-ae5c7cdd710dfa97705d965dcf001a96504e5f31.tar.bz2 |
Merge branch 'dedupe_workset' of https://github.com/bardavid/fio
* 'dedupe_workset' of https://github.com/bardavid/fio:
dedupe: allow to generate dedupe buffers from working set
Diffstat (limited to 'lib/rand.c')
-rw-r--r-- | lib/rand.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -125,10 +125,7 @@ void __fill_random_buf(void *buf, unsigned int len, uint64_t seed) uint64_t fill_random_buf(struct frand_state *fs, void *buf, unsigned int len) { - uint64_t r = __rand(fs); - - if (sizeof(int) != sizeof(long *)) - r *= (unsigned long) __rand(fs); + uint64_t r = __get_next_seed(fs); __fill_random_buf(buf, len, r); return r; @@ -188,10 +185,7 @@ uint64_t fill_random_buf_percentage(struct frand_state *fs, void *buf, unsigned int segment, unsigned int len, char *pattern, unsigned int pbytes) { - uint64_t r = __rand(fs); - - if (sizeof(int) != sizeof(long *)) - r *= (unsigned long) __rand(fs); + uint64_t r = __get_next_seed(fs); __fill_random_buf_percentage(r, buf, percentage, segment, len, pattern, pbytes); |