#include "../verify.h"
/*
- * Limits us to 1GB of mapped files in total
+ * Limits us to 1GiB of mapped files in total
*/
#define MMAP_TOTAL_SZ (1 * 1024 * 1024 * 1024UL)
struct fio_mmap_data *fmd = FILE_ENG_DATA(f);
int flags = 0;
- if (td_rw(td))
+ if (td_rw(td) && !td->o.verify_only)
flags = PROT_READ | PROT_WRITE;
- else if (td_write(td)) {
+ else if (td_write(td) && !td->o.verify_only) {
flags = PROT_WRITE;
if (td->o.verify != VERIFY_NONE)
}
#ifdef FIO_MADV_FREE
- if (f->filetype == FIO_TYPE_BD)
+ if (f->filetype == FIO_TYPE_BLOCK)
(void) posix_madvise(fmd->mmap_ptr, fmd->mmap_sz, FIO_MADV_FREE);
#endif
* It fits within existing mapping, use it
*/
if (io_u->offset >= fmd->mmap_off &&
- io_u->offset + io_u->buflen < fmd->mmap_off + fmd->mmap_sz)
+ io_u->offset + io_u->buflen <= fmd->mmap_off + fmd->mmap_sz)
goto done;
/*