Add ->invalidate() IO engine ops
[fio.git] / filesetup.c
index ad7fb8551da7b87889e3e0ec5d087089e918b5fd..84eaed68c230520f47bd2853cb20225c078938ef 100644 (file)
@@ -401,7 +401,9 @@ static int __file_invalidate_cache(struct thread_data *td, struct fio_file *f,
        dprint(FD_IO, "invalidate cache %s: %llu/%llu\n", f->file_name, off,
                                                                len);
 
-       if (f->mmap_ptr) {
+       if (td->io_ops->invalidate)
+               ret = td->io_ops->invalidate(td, f);
+       else if (f->mmap_ptr) {
                ret = posix_madvise(f->mmap_ptr, f->mmap_sz, POSIX_MADV_DONTNEED);
 #ifdef FIO_MADV_FREE
                if (f->filetype == FIO_TYPE_BD)