Merge branch 'fio-man-page' of https://github.com/bvanassche/fio
[fio.git] / options.c
index 393669ab20aa9f250a482ada4113fc50259de11f..e53b717affbe4e28a9ea8cb267a87cdc6685fedd 100644 (file)
--- a/options.c
+++ b/options.c
@@ -52,7 +52,7 @@ static int bs_cmp(const void *p1, const void *p2)
 
 struct split {
        unsigned int nr;
-       unsigned int val1[ZONESPLIT_MAX];
+       unsigned long long val1[ZONESPLIT_MAX];
        unsigned long long val2[ZONESPLIT_MAX];
 };
 
@@ -119,7 +119,7 @@ static int bssplit_ddir(struct thread_options *o, enum fio_ddir ddir, char *str,
                        bool data)
 {
        unsigned int i, perc, perc_missing;
-       unsigned int max_bs, min_bs;
+       unsigned long long max_bs, min_bs;
        struct split split;
 
        memset(&split, 0, sizeof(split));
@@ -959,48 +959,6 @@ static int zone_split_ddir(struct thread_options *o, enum fio_ddir ddir,
        return 0;
 }
 
-static void __td_zone_gen_index(struct thread_data *td, enum fio_ddir ddir)
-{
-       unsigned int i, j, sprev, aprev;
-       uint64_t sprev_sz;
-
-       td->zone_state_index[ddir] = malloc(sizeof(struct zone_split_index) * 100);
-
-       sprev_sz = sprev = aprev = 0;
-       for (i = 0; i < td->o.zone_split_nr[ddir]; i++) {
-               struct zone_split *zsp = &td->o.zone_split[ddir][i];
-
-               for (j = aprev; j < aprev + zsp->access_perc; j++) {
-                       struct zone_split_index *zsi = &td->zone_state_index[ddir][j];
-
-                       zsi->size_perc = sprev + zsp->size_perc;
-                       zsi->size_perc_prev = sprev;
-
-                       zsi->size = sprev_sz + zsp->size;
-                       zsi->size_prev = sprev_sz;
-               }
-
-               aprev += zsp->access_perc;
-               sprev += zsp->size_perc;
-               sprev_sz += zsp->size;
-       }
-}
-
-/*
- * Generate state table for indexes, so we don't have to do it inline from
- * the hot IO path
- */
-static void td_zone_gen_index(struct thread_data *td)
-{
-       int i;
-
-       td->zone_state_index = malloc(DDIR_RWDIR_CNT *
-                                       sizeof(struct zone_split_index *));
-
-       for (i = 0; i < DDIR_RWDIR_CNT; i++)
-               __td_zone_gen_index(td, i);
-}
-
 static int parse_zoned_distribution(struct thread_data *td, const char *input,
                                    bool absolute)
 {
@@ -1055,9 +1013,7 @@ static int parse_zoned_distribution(struct thread_data *td, const char *input,
                return ret;
        }
 
-       if (!ret)
-               td_zone_gen_index(td);
-       else {
+       if (ret) {
                for (i = 0; i < DDIR_RWDIR_CNT; i++)
                        td->o.zone_split_nr[i] = 0;
        }
@@ -2112,7 +2068,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .name   = "bs",
                .lname  = "Block size",
                .alias  = "blocksize",
-               .type   = FIO_OPT_INT,
+               .type   = FIO_OPT_ULL,
                .off1   = offsetof(struct thread_options, bs[DDIR_READ]),
                .off2   = offsetof(struct thread_options, bs[DDIR_WRITE]),
                .off3   = offsetof(struct thread_options, bs[DDIR_TRIM]),
@@ -2129,7 +2085,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
                .name   = "ba",
                .lname  = "Block size align",
                .alias  = "blockalign",
-               .type   = FIO_OPT_INT,
+               .type   = FIO_OPT_ULL,
                .off1   = offsetof(struct thread_options, ba[DDIR_READ]),
                .off2   = offsetof(struct thread_options, ba[DDIR_WRITE]),
                .off3   = offsetof(struct thread_options, ba[DDIR_TRIM]),
@@ -2163,7 +2119,7 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
        {
                .name   = "bssplit",
                .lname  = "Block size split",
-               .type   = FIO_OPT_STR,
+               .type   = FIO_OPT_STR_ULL,
                .cb     = str_bssplit_cb,
                .off1   = offsetof(struct thread_options, bssplit),
                .help   = "Set a specific mix of block sizes",