[PATCH] Allow proper sharing of files
authorJens Axboe <axboe@suse.de>
Mon, 22 May 2006 18:20:54 +0000 (20:20 +0200)
committerJens Axboe <axboe@suse.de>
Mon, 22 May 2006 18:20:54 +0000 (20:20 +0200)
fio-ini.c
fio.h

index 611bdca884fd805ef175c6801491dd2874d14954..0c83f70246d4b23f59af47b54a862920db2edc7f 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -213,9 +213,9 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass,
 
        if (td->filetype == FIO_TYPE_FILE) {
                if (td->directory[0] != '\0')
 
        if (td->filetype == FIO_TYPE_FILE) {
                if (td->directory[0] != '\0')
-                       sprintf(td->file_name, "%s/%s.%d", td->directory, jobname, td->thread_number);
+                       sprintf(td->file_name, "%s/%s.%d", td->directory, jobname, td->jobnum);
                else
                else
-                       sprintf(td->file_name, "%s.%d", jobname, td->thread_number);
+                       sprintf(td->file_name, "%s.%d", jobname, td->jobnum);
        } else
                strcpy(td->file_name, jobname);
 
        } else
                strcpy(td->file_name, jobname);
 
@@ -263,6 +263,7 @@ static int add_job(struct thread_data *td, const char *jobname, int prioclass,
 
                td_new->numjobs = 1;
                td_new->stonewall = 0;
 
                td_new->numjobs = 1;
                td_new->stonewall = 0;
+               td_new->jobnum = numjobs;
 
                if (add_job(td_new, jobname, prioclass, prio))
                        goto err;
 
                if (add_job(td_new, jobname, prioclass, prio))
                        goto err;
diff --git a/fio.h b/fio.h
index 0844e6aca7df6338cadcca8eda466f225cf7ac16..a183d72d09bf8bb14b811338e5f07476f140ed11 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -146,6 +146,7 @@ struct thread_data {
        unsigned int use_thread;
        unsigned int iodepth;
        os_cpu_mask_t cpumask;
        unsigned int use_thread;
        unsigned int iodepth;
        os_cpu_mask_t cpumask;
+       unsigned int jobnum;
 
        struct drand48_data bsrange_state;
        struct drand48_data verify_state;
 
        struct drand48_data bsrange_state;
        struct drand48_data verify_state;