[PATCH] Add end_fsync option
authorJens Axboe <axboe@suse.de>
Tue, 30 May 2006 11:04:05 +0000 (13:04 +0200)
committerJens Axboe <axboe@suse.de>
Tue, 30 May 2006 11:04:05 +0000 (13:04 +0200)
README
fio-ini.c
fio.c
fio.h

diff --git a/README b/README
index 92cf5c4948677df98640b0e093df73a527246aac..bc2574e7f781b11815fde6eba24732c5610a0e70 100644 (file)
--- a/README
+++ b/README
@@ -73,6 +73,7 @@ The <jobs> format is as follows:
        bwavgtime=x     Average bandwidth stats over an x msec window.
        create_serialize=x      If 'x', serialize file creation.
        create_fsync=x  If 'x', run fsync() after file creation.
+       end_fsync=x     If 'x', run fsync() after end-of-job.
        loops=x         Run the job 'x' number of times.
        verify=x        If 'x' == md5, use md5 for verifies. If 'x' == crc32,
                        use crc32 for verifies. md5 is 'safer', but crc32 is
index 109bc14950fca9d798defbd55a28cc939f907feb..a8ed6d5bcf5ae13fd680d44925e9c59703a4b650 100644 (file)
--- a/fio-ini.c
+++ b/fio-ini.c
@@ -726,6 +726,7 @@ int parse_jobs_ini(char *file)
                        }
                        if (!check_int(p, "fsync", &td->fsync_blocks)) {
                                fgetpos(f, &off);
+                               td->end_fsync = 1;
                                continue;
                        }
                        if (!check_int(p, "startdelay", &td->start_delay)) {
@@ -760,6 +761,10 @@ int parse_jobs_ini(char *file)
                                fgetpos(f, &off);
                                continue;
                        }
+                       if (!check_int(p, "end_fsync", &td->end_fsync)) {
+                               fgetpos(f, &off);
+                               continue;
+                       }
                        if (!check_int(p, "loops", &td->loops)) {
                                fgetpos(f, &off);
                                continue;
diff --git a/fio.c b/fio.c
index 9510dee42971cf244a0cf1bdbec8548765c50d8c..3c35039a6a4788e25bc1abc4165630cb0335769e 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1136,7 +1136,7 @@ static void do_io(struct thread_data *td)
        if (td->cur_depth)
                cleanup_pending_aio(td);
 
-       if (should_fsync(td) && td->fsync_blocks)
+       if (should_fsync(td) && td->end_fsync)
                sync_td(td);
 }
 
diff --git a/fio.h b/fio.h
index fe7efbdc472327a8a1d0b3210b9aec755e8b87fa..4f87fb775f01f161e96ccc25283825ef9989bc33 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -134,6 +134,7 @@ struct thread_data {
        unsigned int bw_avg_time;
        unsigned int create_serialize;
        unsigned int create_fsync;
+       unsigned int end_fsync;
        unsigned int loops;
        unsigned long long file_size;
        unsigned long long real_file_size;