Revert "filesetup: ensure that we align file starting offset"
authorJens Axboe <axboe@fb.com>
Tue, 2 Aug 2016 15:07:07 +0000 (09:07 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 2 Aug 2016 15:07:07 +0000 (09:07 -0600)
There are valid reasons to use an offset that isn't a multiple
of the block size. We previously made this change to fix an
issue with a job file, but that job file had an offset that
wasn't a multiple of the hardware block size. As long as the
offset is a multiple of the hardware block size for unbuffered
IO, then it should be fine.

This reverts commit c465cd14ca958dfdb87bb1998add722d62ae3691.

filesetup.c

index a48faf588140ca79f7f00a8a95f63266a63f7a39..1ecdda61c3f460f8ae03dda4a6a5cce9c7fd5278 100644 (file)
@@ -761,16 +761,12 @@ static unsigned long long get_fs_free_counts(struct thread_data *td)
 uint64_t get_start_offset(struct thread_data *td, struct fio_file *f)
 {
        struct thread_options *o = &td->o;
-       uint64_t offset;
 
        if (o->file_append && f->filetype == FIO_TYPE_FILE)
                return f->real_file_size;
 
-       offset = td->o.start_offset + td->subjob_number * td->o.offset_increment;
-       if (offset % td_max_bs(td))
-               offset -= (offset % td_max_bs(td));
-
-       return offset;
+       return td->o.start_offset +
+               td->subjob_number * td->o.offset_increment;
 }
 
 /*