summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2007-07-19 15:06:57 +0200
committerJens Axboe <jens.axboe@oracle.com>2007-07-19 15:06:57 +0200
commitd87612ac34a3cf1ac94a9ddc0cada672b6541b3c (patch)
treea119fa83ae9e9b8b610cd5fdde18768bf411124c /memory.c
parent088b42076dcbadf4d61367e19e49cb0d12aaadd1 (diff)
malloc memory still needs to be aligned, if we are doing direct IO
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c7
1 files changed, 6 insertions, 1 deletions
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_mmap(struct thread_data *td)
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;