From 591e9e0653dd8f5d8464b2896434a01ab742a3b1 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 15 Mar 2012 14:50:58 +0100 Subject: [PATCH 1/1] Fix offset_increment option and add man page entry for it td->thread_number starts at 1, not 0. So we need to subtract one before multiplying with the offset. Signed-off-by: Jens Axboe --- filesetup.c | 2 +- fio.1 | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/filesetup.c b/filesetup.c index 9acce64a..f3d38290 100644 --- a/filesetup.c +++ b/filesetup.c @@ -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 + - td->thread_number * td->o.offset_increment; + (td->thread_number - 1) * td->o.offset_increment; if (!td->o.file_size_low) { /* diff --git a/fio.1 b/fio.1 index 910812fb..f7abff89 100644 --- 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_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. -- 2.25.1