X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=ioengines.c;h=0e8953404f7e4339572f44aad104f58b2c1a052e;hp=7f0a5c4520bab954d1e8eaa4df04ee115f8290e1;hb=44f29692cfba246981bb3c1b894333a6d2209f51;hpb=e6d2e7ec8134c94e764e10b124ff9379877ec158 diff --git a/ioengines.c b/ioengines.c index 7f0a5c45..0e895340 100644 --- a/ioengines.c +++ b/ioengines.c @@ -431,3 +431,16 @@ int td_io_get_file_size(struct thread_data *td, struct fio_file *f) return td->io_ops->get_file_size(td, f); } + +int do_sync_file_range(struct thread_data *td, struct fio_file *f) +{ + off64_t offset, nbytes; + + offset = f->first_write; + nbytes = f->last_write - f->first_write; + + if (nbytes) + return sync_file_range(f->fd, offset, nbytes, 0); + + return 0; +}