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.
Showing the changes to include/uapi/linux (1 of 2 files). Show all
Unified · Split
| @@ -24,7 +24,7 @@ struct io_uring_sqe { · 23 unmodified lines | ||
| 24 | 24 | __u32 len; /* buffer size or number of iovecs */ |
| 25 | 25 | union { |
| 26 | 26 | __kernel_rwf_t rw_flags; |
| 27 | − __u32 __resv; | |
| 27 | + __u32 fsync_flags; | |
| 28 | 28 | }; |
| 29 | 29 | __u64 user_data; /* data to be passed back at completion time */ |
| 30 | 30 | __u64 __pad2[3]; |
| @@ -33,6 +33,12 @@ struct io_uring_sqe { · 2 unmodified lines | ||
| 33 | 33 | #define IORING_OP_NOP 0 |
| 34 | 34 | #define IORING_OP_READV 1 |
| 35 | 35 | #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 | 44 | * IO completion data structure (Completion Queue Entry) |