unsigned long mask = td->o.hugepage_size - 1;
/* TODO: make sure the file is a real hugetlbfs file */
- if (!td->mmapfile)
+ if (!td->o.mmapfile)
flags |= MAP_HUGETLB;
total_mem = (total_mem + mask) & ~mask;
}
- 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");
td->orig_buffer = NULL;
if (td->mmapfd) {
close(td->mmapfd);
- unlink(td->mmapfile);
+ unlink(td->o.mmapfile);
}
return 1;
dprint(FD_MEM, "munmap %llu %p\n", (unsigned long long) 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);
}
}
total_mem = td->orig_buffer_size;
- if (td->o.odirect || td->o.mem_align ||
+ if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
(td->io_ops->flags & FIO_MEMALIGN)) {
total_mem += page_mask;
if (td->o.mem_align && td->o.mem_align > page_size)
unsigned int total_mem;
total_mem = td->orig_buffer_size;
- if (td->o.odirect)
+ if (td->o.odirect || td->o.oatomic)
total_mem += page_mask;
if (td->o.mem_type == MEM_MALLOC)