[PATCH] Fix hugetlb problems
Alignment was bad, and we need to check the shmhuge string before shm,
otherwise it'll match the latter.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/init.c b/init.c
index bfe6981..7d7c9d6 100644
--- a/init.c
+++ b/init.c
@@ -827,9 +827,6 @@
if (!strncmp(mem, "malloc", 6)) {
td->mem_type = MEM_MALLOC;
return 0;
- } else if (!strncmp(mem, "shm", 3)) {
- td->mem_type = MEM_SHM;
- return 0;
} else if (!strncmp(mem, "mmap", 4)) {
td->mem_type = MEM_MMAP;
return 0;
@@ -841,6 +838,9 @@
log_err("fio: shmhuge not available\n");
return 1;
#endif
+ } else if (!strncmp(mem, "shm", 3)) {
+ td->mem_type = MEM_SHM;
+ return 0;
}
log_err("fio: mem type: malloc, shm, mmap, shmhuge\n");