cleanup: add defines for default pareto or zipf values
authorJens Axboe <axboe@fb.com>
Sun, 4 Jan 2015 17:02:34 +0000 (10:02 -0700)
committerJens Axboe <axboe@fb.com>
Sun, 4 Jan 2015 17:02:34 +0000 (10:02 -0700)
Signed-off-by: Jens Axboe <axboe@fb.com>
fio.h
options.c

diff --git a/fio.h b/fio.h
index 5e352c6cf3cd07722210b06acf6a1b71e0e7b702..be2f23aa9f7662f448c9b1f63b6f087333bdb9a2 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -642,6 +642,9 @@ enum {
        FIO_RAND_DIST_PARETO,
 };
 
        FIO_RAND_DIST_PARETO,
 };
 
+#define FIO_DEF_ZIPF           1.1
+#define FIO_DEF_PARETO         0.2
+
 enum {
        FIO_RAND_GEN_TAUSWORTHE = 0,
        FIO_RAND_GEN_LFSR,
 enum {
        FIO_RAND_GEN_TAUSWORTHE = 0,
        FIO_RAND_GEN_LFSR,
index 12ff621d0f1dfb4c7f96fe3bc2e478e2faa8a46d..ab6e399db5208d81689c0ec9752fa0a7e4adeda1 100644 (file)
--- a/options.c
+++ b/options.c
@@ -715,9 +715,9 @@ static int str_random_distribution_cb(void *data, const char *str)
                return 0;
 
        if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
                return 0;
 
        if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
-               val = 1.1;
+               val = FIO_DEF_ZIPF;
        else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
        else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
-               val = 0.2;
+               val = FIO_DEF_PARETO;
        else
                return 0;
 
        else
                return 0;