Merge branch 'io-threads'
authorJens Axboe <axboe@fb.com>
Thu, 23 Apr 2015 17:13:27 +0000 (11:13 -0600)
committerJens Axboe <axboe@fb.com>
Thu, 23 Apr 2015 17:13:27 +0000 (11:13 -0600)
blktrace.c
configure
lib/libmtd.c
options.c
stat.c
stat.h

index 9afc5be045224165c682e9b71c2ec238cd069c98..e63c7086fcfc2185dfc7b7364aad964707bee8e3 100644 (file)
@@ -456,10 +456,9 @@ int load_blktrace(struct thread_data *td, const char *filename, int need_swap)
        td->o.odirect = 1;
 
        /*
-        * we don't know if this option was set or not. it defaults to 1,
-        * so we'll just guess that we should override it if it's still 1
+        * If depth wasn't manually set, use probed depth
         */
-       if (td->o.iodepth == 1)
+       if (!fio_option_is_set(&td->o, iodepth))
                td->o.iodepth = td->o.iodepth_low = depth;
 
        return 0;
index ff97200cbcfc75e46c4b6fe261567410d8126d4f..8e496b0f852ab7372fe9254cdbd4cd5ecdd6e61f 100755 (executable)
--- a/configure
+++ b/configure
@@ -1378,6 +1378,7 @@ cat > $TMPC << EOF
 int main(int argc, char **argv)
 {
   struct mtd_info_user info;
+  info.type = MTD_MLCNANDFLASH;
   return ioctl(0, MEMGETINFO, &info);
 }
 EOF
index e1b2be19b5c68ceb9d60483e895d1a90e4ba88d5..5c9eac2778c69a5b4bead766f70d74bdc0939705 100644 (file)
@@ -55,7 +55,7 @@ static char *mkpath(const char *path, const char *name)
        size_t len1 = strlen(path);
        size_t len2 = strlen(name);
 
-       n = xmalloc(len1 + len2 + 2);
+       n = xmalloc(len1 + len2 + 6);
 
        memcpy(n, path, len1);
        if (n[len1 - 1] != '/')
index b34e2c72dc3a91e6fe1b15216b0d708d9badb57c..3de1248cce9ef44da252ec41b4578a09b6e39da8 100644 (file)
--- a/options.c
+++ b/options.c
@@ -443,9 +443,9 @@ static int str_cpumask_cb(void *data, unsigned long long *val)
 
        for (i = 0; i < sizeof(int) * 8; i++) {
                if ((1 << i) & *val) {
-                       if (i > max_cpu) {
+                       if (i >= max_cpu) {
                                log_err("fio: CPU %d too large (max=%ld)\n", i,
-                                                               max_cpu);
+                                                               max_cpu - 1);
                                return 1;
                        }
                        dprint(FD_PARSE, "set cpu allowed %d\n", i);
@@ -503,9 +503,9 @@ static int set_cpus_allowed(struct thread_data *td, os_cpu_mask_t *mask,
                                ret = 1;
                                break;
                        }
-                       if (icpu > max_cpu) {
+                       if (icpu >= max_cpu) {
                                log_err("fio: CPU %d too large (max=%ld)\n",
-                                                       icpu, max_cpu);
+                                                       icpu, max_cpu - 1);
                                ret = 1;
                                break;
                        }
diff --git a/stat.c b/stat.c
index 533981fcc89ac20d9297808d8c88ec2b69617202..d143d36c0c60ed1d5d6c1bca6b1aa27bd86c9212 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -1369,7 +1369,7 @@ void __show_run_stats(void)
        struct group_run_stats *runstats, *rs;
        struct thread_data *td;
        struct thread_stat *threadstats, *ts;
-       int i, j, nr_ts, last_ts, idx;
+       int i, j, k, nr_ts, last_ts, idx;
        int kb_base_warned = 0;
        int unit_base_warned = 0;
        struct json_object *root = NULL;
@@ -1481,8 +1481,8 @@ void __show_run_stats(void)
                ts->latency_window = td->o.latency_window;
 
                ts->nr_block_infos = td->ts.nr_block_infos;
-               for (i = 0; i < ts->nr_block_infos; i++)
-                       ts->block_infos[i] = td->ts.block_infos[i];
+               for (k = 0; k < ts->nr_block_infos; k++)
+                       ts->block_infos[k] = td->ts.block_infos[k];
 
                sum_thread_stats(ts, &td->ts, idx);
        }
diff --git a/stat.h b/stat.h
index dd340128537e744e9284358a126a0974a1b2462f..e87dae08fe1ee2f4ea3e0a215356ee5ef5c05fc7 100644 (file)
--- a/stat.h
+++ b/stat.h
@@ -132,7 +132,7 @@ enum block_info_state {
        BLOCK_STATE_TRIM_FAILURE,
        BLOCK_STATE_WRITE_FAILURE,
        BLOCK_STATE_COUNT,
-} state;
+};
 
 #define MAX_PATTERN_SIZE       512
 #define FIO_JOBNAME_SIZE       128