mmap engine: fix for large files on 32-bit archs
authorJens Axboe <jens.axboe@oracle.com>
Mon, 29 Jun 2009 09:54:56 +0000 (11:54 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 29 Jun 2009 09:54:56 +0000 (11:54 +0200)
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
engines/mmap.c

index 6671fc0e66d8e78e9f7c0fbeac8dd98a8b4d0946..bd9a9428661abe38048233c0c56c5be256ee7311 100644 (file)
@@ -15,9 +15,9 @@
 #include "../verify.h"
 
 /*
 #include "../verify.h"
 
 /*
- * Limits us to 2GB of mapped files in total
+ * Limits us to 1GB of mapped files in total
  */
  */
-#define MMAP_TOTAL_SZ  (2 * 1024 * 1024 * 1024UL)
+#define MMAP_TOTAL_SZ  (1 * 1024 * 1024 * 1024UL)
 
 static unsigned long mmap_map_size;
 static unsigned long mmap_map_mask;
 
 static unsigned long mmap_map_size;
 static unsigned long mmap_map_mask;
@@ -90,9 +90,7 @@ static int fio_mmapio_prep(struct thread_data *td, struct io_u *io_u)
        if (f->mmap_sz  > f->io_size)
                f->mmap_sz = f->io_size;
 
        if (f->mmap_sz  > f->io_size)
                f->mmap_sz = f->io_size;
 
-       f->mmap_off = io_u->offset & ~mmap_map_mask;
-       if (io_u->offset + io_u->buflen >= f->mmap_off + f->mmap_sz)
-               f->mmap_off -= io_u->buflen;
+       f->mmap_off = io_u->offset;
 
        ret = fio_mmap_file(td, f, f->mmap_sz, f->mmap_off);
 done:
 
        ret = fio_mmap_file(td, f, f->mmap_sz, f->mmap_off);
 done: