diff options
| author | Jens Axboe <axboe@kernel.dk> | 2019-02-08 16:13:31 -0700 | 
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2019-02-08 21:02:00 -0700 | 
| commit | 6726376f321289f2d5801adf96ad2ed6c0c3a8a2 (patch) | |
| tree | b48bfff6b0e071f587dc8ac5d492d7557820c565 /src | |
| parent | 996b5a65a58cfd3334fcc6c268911126ced35d61 (diff) | |
test/fsync: add simple fsync tester
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'src')
| -rw-r--r-- | src/liburing.h | 10 | 
1 files changed, 10 insertions, 0 deletions
| 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 | 
