[PATCH] Misc: stall progress ouput during file creation, ini_file frees.
authorJens Axboe <axboe@suse.de>
Fri, 9 Jun 2006 09:28:10 +0000 (11:28 +0200)
committerJens Axboe <axboe@suse.de>
Fri, 9 Jun 2006 09:28:10 +0000 (11:28 +0200)
fio.c
init.c

diff --git a/fio.c b/fio.c
index 3cc09891ddcda2ff08ad68050faa89e52e9e7419..b53a58ebe1883bbc9ad17f83fd598ce0c81c0c3c 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -43,6 +43,7 @@ int thread_number = 0;
 static char run_str[MAX_JOBS + 1];
 int shm_id = 0;
 static struct timeval genesis;
 static char run_str[MAX_JOBS + 1];
 int shm_id = 0;
 static struct timeval genesis;
+static int temp_stall_ts;
 
 static void print_thread_status(void);
 
 
 static void print_thread_status(void);
 
@@ -960,6 +961,8 @@ static int create_file(struct thread_data *td, unsigned long long size,
                return 1;
        }
 
                return 1;
        }
 
+       temp_stall_ts = 1;
+
        if (!extend) {
                oflags = O_CREAT | O_TRUNC;
                fprintf(f_out, "%s: Laying out IO file (%LuMiB)\n", td->name, size >> 20);
        if (!extend) {
                oflags = O_CREAT | O_TRUNC;
                fprintf(f_out, "%s: Laying out IO file (%LuMiB)\n", td->name, size >> 20);
@@ -971,11 +974,13 @@ static int create_file(struct thread_data *td, unsigned long long size,
        td->fd = open(td->file_name, O_WRONLY | oflags, 0644);
        if (td->fd < 0) {
                td_verror(td, errno);
        td->fd = open(td->file_name, O_WRONLY | oflags, 0644);
        if (td->fd < 0) {
                td_verror(td, errno);
+               temp_stall_ts = 0;
                return 1;
        }
 
        if (!extend && ftruncate(td->fd, td->file_size) == -1) {
                td_verror(td, errno);
                return 1;
        }
 
        if (!extend && ftruncate(td->fd, td->file_size) == -1) {
                td_verror(td, errno);
+               temp_stall_ts = 0;
                return 1;
        }
 
                return 1;
        }
 
@@ -1009,6 +1014,7 @@ static int create_file(struct thread_data *td, unsigned long long size,
        else if (td->create_fsync)
                fsync(td->fd);
 
        else if (td->create_fsync)
                fsync(td->fd);
 
+       temp_stall_ts = 0;
        close(td->fd);
        td->fd = -1;
        free(b);
        close(td->fd);
        td->fd = -1;
        free(b);
@@ -1570,6 +1576,9 @@ static void print_thread_status(void)
        char eta_str[32];
        double perc = 0.0;
 
        char eta_str[32];
        double perc = 0.0;
 
+       if (temp_stall_ts)
+               return;
+
        eta_secs = malloc(thread_number * sizeof(int));
        memset(eta_secs, 0, thread_number * sizeof(int));
 
        eta_secs = malloc(thread_number * sizeof(int));
        memset(eta_secs, 0, thread_number * sizeof(int));
 
diff --git a/init.c b/init.c
index de9cb4983a57d151ce444c03823b0beab7cfc6f3..ee9ab7d2ab6772b95b718c7ff94afcb9315bae7f 100644 (file)
--- a/init.c
+++ b/init.c
@@ -1118,7 +1118,9 @@ int parse_options(int argc, char *argv[])
                        return 1;
                if (parse_jobs_ini(ini_file[i]))
                        return 1;
                        return 1;
                if (parse_jobs_ini(ini_file[i]))
                        return 1;
+               free(ini_file[i]);
        }
 
        }
 
+       free(ini_file);
        return 0;
 }
        return 0;
 }