diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-09-12 14:24:23 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-09-12 14:24:23 -0600 |
commit | 4c29a34fcc8cae333ec8b7af7657495745153b44 (patch) | |
tree | 68e58dd609b06c9f2a550c4622d249c8b02bd6e0 | |
parent | f4f37131558402109b113e731d583aadb3fc38a4 (diff) | |
parent | 01387bfea4b07e6a3df636a5e5e9b0f31b016fc1 (diff) | |
download | fio-4c29a34fcc8cae333ec8b7af7657495745153b44.tar.gz fio-4c29a34fcc8cae333ec8b7af7657495745153b44.tar.bz2 |
Merge branch 'ioring_add_sync_file_range' of https://github.com/anarazel/fio
* 'ioring_add_sync_file_range' of https://github.com/anarazel/fio:
engines/io_uring: Add support for sync_file_range.
-rw-r--r-- | engines/io_uring.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/engines/io_uring.c b/engines/io_uring.c index 8c4bcc57..53cb60c5 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; |