From 6726376f321289f2d5801adf96ad2ed6c0c3a8a2 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 8 Feb 2019 16:13:31 -0700 Subject: test/fsync: add simple fsync tester Signed-off-by: Jens Axboe --- src/liburing.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/liburing.h b/src/liburing.h index 2e7303c..6b0ce71 100644 --- a/src/liburing.h +++ b/src/liburing.h @@ -115,4 +115,14 @@ static inline void io_uring_prep_poll_remove(struct io_uring_sqe *sqe, sqe->addr = (unsigned long) user_data; } +static inline void io_uring_prep_fsync(struct io_uring_sqe *sqe, int fd, + int datasync) +{ + memset(sqe, 0, sizeof(*sqe)); + sqe->opcode = IORING_OP_FSYNC; + sqe->fd = fd; + if (datasync) + sqe->fsync_flags = IORING_FSYNC_DATASYNC; +} + #endif -- cgit