Skip to content

Commit

Permalink
minor fix.
Browse files Browse the repository at this point in the history
Signed-off-by: Lipeng Zhu <[email protected]>
Co-authored-by: Wangyang Guo <[email protected]>
  • Loading branch information
lipzhu and guowangy committed Jun 16, 2024
1 parent 3c9216f commit 7721b7b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ io_uring *getIOUring() {

/* Submit fdatasync request to io_uring. */
void ioUringPrepFsyncAndSubmit(io_uring *io_uring, int fd) {
struct io_uring_sqe *sqe = io_uring_get_sqe(_io_uring);
struct io_uring_sqe *sqe = io_uring_get_sqe(io_uring);
io_uring_prep_fsync(sqe, fd, IORING_FSYNC_DATASYNC);
io_uring_queue_len++;
io_uring_submit(_io_uring);
io_uring_submit(io_uring);
}

void ioUringWaitFsyncBarrier(io_uring *io_uring) {
Expand Down Expand Up @@ -72,18 +72,24 @@ void freeIOUring(void) {
}
}
#else
#ifndef UNUSED
#define UNUSED(V) ((void)V)
#endif

void initIOUring(void) {
}

io_uring *getIOUring(void) {
return NULL;
return 0;
}

void ioUringPrepFsyncAndSubmit(io_uring *io_uring, int fd) {
UNUSED(io_uring);
UNUSED(fd);
}

void ioUringWaitFsyncBarrier(io_uring *io_uring) {
UNUSED(io_uring);
}

void freeIOUring(void) {
Expand Down

0 comments on commit 7721b7b

Please sign in to comment.