[PATCH] fio: if no size given for read, just use file size
authorJens Axboe <axboe@suse.de>
Tue, 15 Nov 2005 15:55:47 +0000 (16:55 +0100)
committerJens Axboe <axboe@suse.de>
Tue, 15 Nov 2005 15:55:47 +0000 (16:55 +0100)
fio.c

diff --git a/fio.c b/fio.c
index aa45e3c2f95052c3a64ec48e8d8e4c395fe976e7..22db6fc232e0df7e392bc6b7627f184647c86f53 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -1214,7 +1214,9 @@ static int get_file_size(struct thread_data *td)
                bytes = st.st_size;
 
        if (td_read(td)) {
-               if (td->file_size > bytes)
+               if (!td->file_size)
+                       td->file_size = bytes;
+               else if (td->file_size > bytes)
                        bytes = td->file_size;
        } else {
                if (!td->file_size)