Fix address truncation on Windows
authorBruce Cran <bruce@cran.org.uk>
Wed, 4 Apr 2012 00:00:00 +0000 (18:00 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 4 Apr 2012 00:00:00 +0000 (18:00 -0600)
Avoid having PAGE_ALIGN truncate addresses by using a pointer-sized
variable for the page size and mask.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
fio.c
fio.h

diff --git a/fio.c b/fio.c
index be60c5ff64bce2a3b24760bf668ce477ba2a84c5..ac026fba8117ed09995ba4cfd398ab1f10bf19d3 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -36,8 +36,8 @@
 #include "memalign.h"
 #include "server.h"
 
 #include "memalign.h"
 #include "server.h"
 
-unsigned long page_mask;
-unsigned long page_size;
+uintptr_t page_mask;
+uintptr_t page_size;
 
 static int endian_check(void)
 {
 
 static int endian_check(void)
 {
diff --git a/fio.h b/fio.h
index cf2e3c51aa2d2c9a4430164638f3ca60de2d4c76..6da22f039c8b1216762ec7ae349fb66b0d5bf229 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -528,7 +528,7 @@ extern int groupid;
 extern int terse_output;
 extern int temp_stall_ts;
 extern unsigned long long mlock_size;
 extern int terse_output;
 extern int temp_stall_ts;
 extern unsigned long long mlock_size;
-extern unsigned long page_mask, page_size;
+extern uintptr_t page_mask, page_size;
 extern int read_only;
 extern int eta_print;
 extern unsigned long done_secs;
 extern int read_only;
 extern int eta_print;
 extern unsigned long done_secs;