commit | d87612ac34a3cf1ac94a9ddc0cada672b6541b3c | [log] [tgz] |
---|---|---|
author | Jens Axboe <jens.axboe@oracle.com> | Thu Jul 19 15:06:57 2007 +0200 |
committer | Jens Axboe <jens.axboe@oracle.com> | Thu Jul 19 15:06:57 2007 +0200 |
tree | a119fa83ae9e9b8b610cd5fdde18768bf411124c | |
parent | 088b42076dcbadf4d61367e19e49cb0d12aaadd1 [diff] [blame] |
malloc memory still needs to be aligned, if we are doing direct IO Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/memory.c b/memory.c index 46eb852..c147229 100644 --- a/memory.c +++ b/memory.c
@@ -126,7 +126,12 @@ static int alloc_mem_malloc(struct thread_data *td) { - td->orig_buffer = malloc(td->orig_buffer_size); + unsigned int bsize = td->orig_buffer_size; + + if (td->o.odirect) + bsize += page_mask; + + td->orig_buffer = malloc(bsize); if (td->orig_buffer) return 0;