Random IO fixes
authorJens Axboe <jens.axboe@oracle.com>
Fri, 25 Jan 2008 13:02:15 +0000 (14:02 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 25 Jan 2008 13:02:15 +0000 (14:02 +0100)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
filesetup.c
io_u.c

index 61d21590738bcf89e116bffb1041e62175f98f0c..f509220276c4097cb7c60e740b3f0204ba08a1fb 100644 (file)
@@ -404,7 +404,7 @@ int setup_files(struct thread_data *td)
                         */
                        f->io_size = td->o.size / td->o.nr_files;
                        if (!f->io_size)
                         */
                        f->io_size = td->o.size / td->o.nr_files;
                        if (!f->io_size)
-                               f->io_size = f->real_file_size;
+                               f->io_size = f->real_file_size - f->file_offset;
                } else if (f->real_file_size < td->o.file_size_low ||
                           f->real_file_size > td->o.file_size_high) {
                        if (f->file_offset > td->o.file_size_low) 
                } else if (f->real_file_size < td->o.file_size_low ||
                           f->real_file_size > td->o.file_size_high) {
                        if (f->file_offset > td->o.file_size_low) 
diff --git a/io_u.c b/io_u.c
index 7890a87099c26f7d5802f9a0479e8ddc6d768bad..a963441a9d3e6baabf4e312146638d90cb46f708 100644 (file)
--- a/io_u.c
+++ b/io_u.c
@@ -118,7 +118,7 @@ static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
                /*
                 * calculate map offset and chec if it's free
                 */
                /*
                 * calculate map offset and chec if it's free
                 */
-               rb = *b + (f->file_offset / td->o.min_bs[ddir]);
+               rb = *b;
                if (random_map_free(td, f, rb))
                        return 0;
 
                if (random_map_free(td, f, rb))
                        return 0;