test/fsync: add simple fsync tester

Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2019-02-08 16:13:31 -07:00
parent 996b5a65a5
commit 6726376f32
3 changed files with 72 additions and 2 deletions

View File

@@ -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