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
24 __u32 len; /* buffer size or number of iovecs */24 __u32 len; /* buffer size or number of iovecs */
25 union {25 union {
26 __kernel_rwf_t rw_flags;26 __kernel_rwf_t rw_flags;
27 __u32 __resv;27 __u32 fsync_flags;
28 };28 };
29 __u64 user_data; /* data to be passed back at completion time */29 __u64 user_data; /* data to be passed back at completion time */
30 __u64 __pad2[3];30 __u64 __pad2[3];
@@ -33,6 +33,12 @@ struct io_uring_sqe { · 2 unmodified lines
33#define IORING_OP_NOP 033#define IORING_OP_NOP 0
34#define IORING_OP_READV 134#define IORING_OP_READV 1
35#define IORING_OP_WRITEV 235#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)
36 42
37/*43/*
38 * IO completion data structure (Completion Queue Entry)44 * 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