summaryrefslogtreecommitdiff
path: root/lib/zipf.h
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2018-09-17 11:00:50 -0600
committerJens Axboe <axboe@kernel.dk>2018-09-17 11:00:50 -0600
commitabb60c32c26d6421283d2a72170508dfb2b94507 (patch)
treeee809dbb1edb67e54e9cdcdc445ef8b2180ff35d /lib/zipf.h
parenta0c84dd4354eaf0a84b8bf0a3126f65301f2206f (diff)
downloadfio-abb60c32c26d6421283d2a72170508dfb2b94507.tar.gz
fio-abb60c32c26d6421283d2a72170508dfb2b94507.tar.bz2
Random distribution 32-bit fixes
We calculate and use nranges as an unsigned long, but that can be 32-bit on some platforms and hence overflow. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'lib/zipf.h')
-rw-r--r--lib/zipf.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/zipf.h b/lib/zipf.h
index a4aa163c..16b65f57 100644
--- a/lib/zipf.h
+++ b/lib/zipf.h
@@ -16,11 +16,11 @@ struct zipf_state {
bool disable_hash;
};
-void zipf_init(struct zipf_state *zs, unsigned long nranges, double theta, unsigned int seed);
-unsigned long long zipf_next(struct zipf_state *zs);
+void zipf_init(struct zipf_state *zs, uint64_t nranges, double theta, unsigned int seed);
+uint64_t zipf_next(struct zipf_state *zs);
-void pareto_init(struct zipf_state *zs, unsigned long nranges, double h, unsigned int seed);
-unsigned long long pareto_next(struct zipf_state *zs);
+void pareto_init(struct zipf_state *zs, uint64_t nranges, double h, unsigned int seed);
+uint64_t pareto_next(struct zipf_state *zs);
void zipf_disable_hash(struct zipf_state *zs);
#endif