Add support for backwards holes
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>
diff --git a/io_u.c b/io_u.c
index 7709df5..16c98b1 100644
--- a/io_u.c
+++ b/io_u.c
@@ -249,8 +249,12 @@
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;