diff options
author | Jens Axboe <axboe@kernel.dk> | 2019-04-10 21:56:54 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-04-10 21:56:54 -0600 |
commit | 986440978828fb13453ad64fc70bb13ec8f745d8 (patch) | |
tree | a2e0dea41535f3291f62011e4c7a64e9bd45217b /test | |
parent | 0656d71c964b3dba006f854ff0f6e9707e1f1d2b (diff) |
test/fsync: update for IOSQE_IO_DRAIN approach
I generalized the barrier flag to be applicable to all commands, so
let's drop the fsync special flag.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'test')
-rw-r--r-- | test/fsync.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/fsync.c b/test/fsync.c index 771e0d5..b854a44 100644 --- a/test/fsync.c +++ b/test/fsync.c @@ -35,7 +35,7 @@ static int test_single_fsync(struct io_uring *ring) ret = io_uring_submit(ring); if (ret <= 0) { - printf("sqe submit failed\n"); + printf("sqe submit failed: %d\n", ret); goto err; } @@ -90,9 +90,9 @@ static int test_barrier_fsync(struct io_uring *ring) goto err; } - io_uring_prep_fsync(sqe, fd, - IORING_FSYNC_DATASYNC | IORING_FSYNC_BARRIER); + io_uring_prep_fsync(sqe, fd, IORING_FSYNC_DATASYNC); sqe->user_data = 1; + sqe->flags = IOSQE_IO_DRAIN; ret = io_uring_submit(ring); if (ret <= 0) { @@ -141,12 +141,16 @@ int main(int argc, char *argv[]) } ret = test_single_fsync(&ring); - if (ret) + if (ret) { + printf("test_single_fsync failed\n"); return ret; + } ret = test_barrier_fsync(&ring); - if (ret) + if (ret) { + printf("test_single_fsync failed\n"); return ret; + } return 0; } |