summaryrefslogtreecommitdiff
path: root/memory.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-01-20 18:38:11 -0700
committerJens Axboe <axboe@fb.com>2015-01-20 18:38:11 -0700
commit91e475290c03db58f856a62f763d29e964934114 (patch)
tree65f118683953157056db4d8784aa45a086e051d6 /memory.c
parentba40757ed67c00b37dda3639e97c3ba0259840a4 (diff)
shm: disable iomem=shm* for shm disabled
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'memory.c')
-rw-r--r--memory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/memory.c b/memory.c
index f81c2dd..23a0d94 100644
--- a/memory.c
+++ b/memory.c
@@ -63,6 +63,7 @@ int fio_pin_memory(struct thread_data *td)
static int alloc_mem_shm(struct thread_data *td, unsigned int total_mem)
{
+#ifndef CONFIG_NO_SHM
int flags = IPC_CREAT | S_IRUSR | S_IWUSR;
if (td->o.mem_type == MEM_SHMHUGE) {
@@ -104,15 +105,21 @@ static int alloc_mem_shm(struct thread_data *td, unsigned int total_mem)
}
return 0;
+#else
+ log_err("fio: shm not supported\n");
+ return 1;
+#endif
}
static void free_mem_shm(struct thread_data *td)
{
+#ifndef CONFIG_NO_SHM
struct shmid_ds sbuf;
dprint(FD_MEM, "shmdt/ctl %d %p\n", td->shm_id, td->orig_buffer);
shmdt(td->orig_buffer);
shmctl(td->shm_id, IPC_RMID, &sbuf);
+#endif
}
static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)