summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james>2021-02-14 02:48:29 +0000
committerjames <james>2021-02-14 02:48:29 +0000
commitb1815ff83628faacc90844eccacd30887e9defd1 (patch)
tree46d00ff3f05c07eeb051905607bcb17ee0f88218
parent5671af310f7c2b0b88101511163188171ba4715d (diff)
downloadliburing-b1815ff83628faacc90844eccacd30887e9defd1.tar.gz
liburing-b1815ff83628faacc90844eccacd30887e9defd1.tar.bz2
Added prep function for sync_file_range op
-rw-r--r--src/include/liburing.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/liburing.h b/src/include/liburing.h
index 6b2cfa1..65dddf7 100644
--- a/src/include/liburing.h
+++ b/src/include/liburing.h
@@ -527,6 +527,13 @@ static inline void io_uring_prep_renameat(struct io_uring_sqe *sqe, int olddfd,
sqe->rename_flags = flags;
}
+static inline void io_uring_prep_sync_file_range(struct io_uring_sqe *sqe, int fd,
+ unsigned len, off_t offset, int flags)
+{
+ io_uring_prep_rw(IORING_OP_SYNC_FILE_RANGE, sqe, fd, NULL, len, offset);
+ sqe->sync_range_flags = flags;
+}
+
/*
* Returns number of unconsumed (if SQPOLL) or unsubmitted entries exist in
* the SQ ring