History

io_uring: add fsync support

Add a new fsync opcode, which either syncs a range if one is passed, or the whole file if the offset and length fields are both cleared to zero. A flag is provided to use fdatasync semantics, that is only force out metadata which is required to retrieve the file data, but not others like metadata.

Christoph Hellwig committed 7 years ago

Commit c992fe21 parent 2b188cc2 files · +61 −1Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/io_uring.h+7−1
@@ -24,7 +24,7 @@ struct io_uring_sqe { · 23 unmodified lines
2424 __u32 len; /* buffer size or number of iovecs */
2525 union {
2626 __kernel_rwf_t rw_flags;
27− __u32 __resv;
27+ __u32 fsync_flags;
2828 };
2929 __u64 user_data; /* data to be passed back at completion time */
3030 __u64 __pad2[3];
@@ -33,6 +33,12 @@ struct io_uring_sqe { · 2 unmodified lines
3333 #define IORING_OP_NOP 0
3434 #define IORING_OP_READV 1
3535 #define IORING_OP_WRITEV 2
36+#define IORING_OP_FSYNC 3
37+
38+/*
39+ * sqe->fsync_flags
40+ */
41+#define IORING_FSYNC_DATASYNC (1U << 0)
3642
3743 /*
3844 * IO completion data structure (Completion Queue Entry)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t