Don't align memory unless using raw io
authorJens Axboe <jens.axboe@oracle.com>
Fri, 20 Jul 2007 10:39:22 +0000 (12:39 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 20 Jul 2007 10:39:22 +0000 (12:39 +0200)
If it's not raw io, we didn't align the buffer size. So we cannot
align.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
fio.c

diff --git a/fio.c b/fio.c
index ead118ec35a0d02572a5366f4fe065a904c0cf05..1e69ce4228c624f3775a95e3299bde84c1e0baef 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -638,7 +638,11 @@ static int init_io_u(struct thread_data *td)
        if (allocate_io_mem(td))
                return 1;
 
        if (allocate_io_mem(td))
                return 1;
 
-       p = ALIGN(td->orig_buffer);
+       if (td->o.odirect)
+               p = ALIGN(td->orig_buffer);
+       else
+               p = td->orig_buffer;
+
        for (i = 0; i < max_units; i++) {
                if (td->terminate)
                        return 1;
        for (i = 0; i < max_units; i++) {
                if (td->terminate)
                        return 1;