[PATCH] Stonewalling wasn't properly done in some circumstances
authorJens Axboe <axboe@suse.de>
Tue, 13 Jun 2006 12:53:38 +0000 (14:53 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 13 Jun 2006 12:53:38 +0000 (14:53 +0200)
We don't want to stonewall individual jobs in a file, but that
happened inadvertently with the multi file change. Get it right,
stonewall the first job in all files except the first.

init.c

diff --git a/init.c b/init.c
index b310f6633236ac4720b4ef8f7375bcfddea5d276..2df509b24630b05c421c5152709701dfa41bcac9 100644 (file)
--- a/init.c
+++ b/init.c
@@ -625,7 +625,7 @@ static int str_ioengine_cb(struct thread_data *td, char *str)
 /*
  * This is our [ini] type file parser.
  */
-int parse_jobs_ini(char *file)
+int parse_jobs_ini(char *file, int stonewall_flag)
 {
        unsigned int prioclass, prio, cpu, global, il;
        unsigned long long ull;
@@ -635,7 +635,7 @@ int parse_jobs_ini(char *file)
        fpos_t off;
        FILE *f;
        char *p;
-       int ret = 0, stonewall = 1;
+       int ret = 0, stonewall;
 
        f = fopen(file, "r");
        if (!f) {
@@ -647,6 +647,7 @@ int parse_jobs_ini(char *file)
        name = malloc(256);
        tmpbuf = malloc(4096);
 
+       stonewall = stonewall_flag;
        while ((p = fgets(string, 4096, f)) != NULL) {
                if (ret)
                        break;
@@ -1157,7 +1158,7 @@ int parse_options(int argc, char *argv[])
        for (i = 0; i < job_files; i++) {
                if (fill_def_thread())
                        return 1;
-               if (parse_jobs_ini(ini_file[i]))
+               if (parse_jobs_ini(ini_file[i], i))
                        return 1;
                free(ini_file[i]);
        }