If you did:
bs=4k
rw=read:-8k
you would essentially rewind by 8k after reading 4k, causing
the read to be sequentially backwards.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
unsigned int rw_seq;
unsigned int kb_base;
unsigned int ddir_seq_nr;
unsigned int rw_seq;
unsigned int kb_base;
unsigned int ddir_seq_nr;
- unsigned long ddir_seq_add;
unsigned int iodepth;
unsigned int iodepth_low;
unsigned int iodepth_batch;
unsigned int iodepth;
unsigned int iodepth_low;
unsigned int iodepth_batch;
assert(ddir_rw(ddir));
if (f->last_pos < f->real_file_size) {
assert(ddir_rw(ddir));
if (f->last_pos < f->real_file_size) {
- unsigned long long pos = f->last_pos - f->file_offset;
+ unsigned long long pos;
+ if (f->last_pos == f->file_offset && td->o.ddir_seq_add < 0)
+ f->last_pos = f->real_file_size;
+
+ pos = f->last_pos - f->file_offset;
if (pos)
pos += td->o.ddir_seq_add;
if (pos)
pos += td->o.ddir_seq_add;