Fix offset_increment option and add man page entry for it
authorJens Axboe <axboe@kernel.dk>
Thu, 15 Mar 2012 13:50:58 +0000 (14:50 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Mar 2012 13:50:58 +0000 (14:50 +0100)
td->thread_number starts at 1, not 0. So we need to subtract
one before multiplying with the offset.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
filesetup.c
fio.1

index 9acce64a45fc91eecbce536b89c7dc015dc3a713..f3d38290179e80d9eacefb5f2a97ef4abd479720 100644 (file)
@@ -714,7 +714,7 @@ int setup_files(struct thread_data *td)
        need_extend = 0;
        for_each_file(td, f, i) {
                f->file_offset = td->o.start_offset +
        need_extend = 0;
        for_each_file(td, f, i) {
                f->file_offset = td->o.start_offset +
-                       td->thread_number * td->o.offset_increment;
+                       (td->thread_number - 1) * td->o.offset_increment;
 
                if (!td->o.file_size_low) {
                        /*
 
                if (!td->o.file_size_low) {
                        /*
diff --git a/fio.1 b/fio.1
index 910812fb5bef351bc8a8ca5d557aacb3bf2e0a8f..f7abff89b6623cd7746aa34bd87af9552d0521da 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -495,6 +495,13 @@ Default: true.
 .BI offset \fR=\fPint
 Offset in the file to start I/O. Data before the offset will not be touched.
 .TP
 .BI offset \fR=\fPint
 Offset in the file to start I/O. Data before the offset will not be touched.
 .TP
+.BI offset_increment \fR=\fPint
+If this is provided, then the real offset becomes the
+offset + offset_increment * thread_number, where the thread number is a counter
+that starts at 0 and is incremented for each job. This option is useful if
+there are several jobs which are intended to operate on a file in parallel in
+disjoint segments, with even spacing between the starting points.
+.TP
 .BI fsync \fR=\fPint
 How many I/Os to perform before issuing an \fBfsync\fR\|(2) of dirty data.  If
 0, don't sync.  Default: 0.
 .BI fsync \fR=\fPint
 How many I/Os to perform before issuing an \fBfsync\fR\|(2) of dirty data.  If
 0, don't sync.  Default: 0.