summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-09-12 11:17:08 -0700
committerAndres Freund <andres@anarazel.de>2019-09-12 11:22:47 -0700
commit01387bfea4b07e6a3df636a5e5e9b0f31b016fc1 (patch)
tree84c50e098a8f85406701a7b359c1c53c3295c7e7
parent17318cf6e42ef6b8d14e400eb1f6cc78dd668e1d (diff)
downloadfio-01387bfea4b07e6a3df636a5e5e9b0f31b016fc1.tar.gz
fio-01387bfea4b07e6a3df636a5e5e9b0f31b016fc1.tar.bz2
engines/io_uring: Add support for sync_file_range.
Previously sync_file_range() requests were just dropped to the floor. Signed-off-by: Andres Freund <andres@anarazel.de>
-rw-r--r--engines/io_uring.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/io_uring.c b/engines/io_uring.c
index 65f8e236..93ffb5bd 100644
--- a/engines/io_uring.c
+++ b/engines/io_uring.c
@@ -181,10 +181,17 @@ static int fio_ioring_prep(struct thread_data *td, struct io_u *io_u)
}
sqe->off = io_u->offset;
} else if (ddir_sync(io_u->ddir)) {
- sqe->fsync_flags = 0;
- if (io_u->ddir == DDIR_DATASYNC)
- sqe->fsync_flags |= IORING_FSYNC_DATASYNC;
- sqe->opcode = IORING_OP_FSYNC;
+ if (io_u->ddir == DDIR_SYNC_FILE_RANGE) {
+ sqe->off = f->first_write;
+ sqe->len = f->last_write - f->first_write;
+ sqe->sync_range_flags = td->o.sync_file_range;
+ sqe->opcode = IORING_OP_SYNC_FILE_RANGE;
+ } else {
+ sqe->fsync_flags = 0;
+ if (io_u->ddir == DDIR_DATASYNC)
+ sqe->fsync_flags |= IORING_FSYNC_DATASYNC;
+ sqe->opcode = IORING_OP_FSYNC;
+ }
}
sqe->user_data = (unsigned long) io_u;