Start the process of making options more gfio friendly
[fio.git] / memory.c
index 82a79bd7175b9a74ca0846a669d767e06d50b84d..0135abb1b0eb42d574eed3fe646a69908de12983 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -121,8 +121,8 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
 
        td->mmapfd = 1;
 
-       if (td->mmapfile) {
-               td->mmapfd = open(td->mmapfile, O_RDWR|O_CREAT, 0644);
+       if (td->o.mmapfile) {
+               td->mmapfd = open(td->o.mmapfile, O_RDWR|O_CREAT, 0644);
 
                if (td->mmapfd < 0) {
                        td_verror(td, errno, "open mmap file");
@@ -146,7 +146,7 @@ static int alloc_mem_mmap(struct thread_data *td, size_t total_mem)
                td->orig_buffer = NULL;
                if (td->mmapfd) {
                        close(td->mmapfd);
-                       unlink(td->mmapfile);
+                       unlink(td->o.mmapfile);
                }
 
                return 1;
@@ -159,10 +159,10 @@ static void free_mem_mmap(struct thread_data *td, size_t total_mem)
 {
        dprint(FD_MEM, "munmap %u %p\n", total_mem, td->orig_buffer);
        munmap(td->orig_buffer, td->orig_buffer_size);
-       if (td->mmapfile) {
+       if (td->o.mmapfile) {
                close(td->mmapfd);
-               unlink(td->mmapfile);
-               free(td->mmapfile);
+               unlink(td->o.mmapfile);
+               free(td->o.mmapfile);
        }
 }