Fix oc-rsyncd test config section#1923
Merged
Merged
Conversation
3 tasks
oferchen
added a commit
that referenced
this pull request
May 6, 2026
Closes #1921, #1923. Adds a typed wrapper around `IORING_OP_LINKAT` (Linux 5.15+) so the receiver can submit hardlink creation alongside disk writes on the same ring instead of issuing a synchronous `linkat(2)` syscall per hardlinked file. The new `linkat` submodule mirrors the conventions used by `shared_ring::probe_poll_add` and `splice::is_splice_available`: - `LINKAT_MIN_KERNEL = (5, 15)` and `IORING_OP_LINKAT = 39` constants. - `linkat_supported()` short-circuits on `is_io_uring_available()`, builds a throwaway ring, and asks the kernel via `IORING_REGISTER_PROBE` whether opcode 39 is supported. The result is cached in a process-wide `OnceLock`. - `LinkAtArgs<'a>` borrows source/destination `&CStr` paths plus dirfds and `flags` so the compiler enforces the kernel's path lifetime contract. - `build_linkat_sqe` returns `io::ErrorKind::Unsupported` when the probe is `false`; `build_linkat_sqe_unchecked` exposes the encoder for unit tests. - `submit_linkat_blocking` builds a private 2-entry ring, submits the SQE, and returns the kernel's CQE result. The non-Linux stub in `io_uring_stub.rs` provides the same names with `linkat_supported() -> false` and `Unsupported` round-trips. Public re-exports in `crates/fast_io/src/lib.rs` and the Linux `io_uring` module make the API available to consumer crates. Tests: - Unit tests verify `opcode::LinkAt::CODE == 39`, the cached probe is idempotent, the unchecked SQE encoder accepts user_data, and the stub consistently returns `Unsupported`. - `tests/io_uring_linkat.rs` (Linux+`io_uring` feature) submits a real LINKAT, verifies the destination hardlink, and unlinks it; skips when the kernel does not advertise the opcode.
oferchen
added a commit
that referenced
this pull request
May 6, 2026
* feat(fast_io): add io_uring LINKAT wrapper and kernel probe Closes #1921, #1923. Adds a typed wrapper around `IORING_OP_LINKAT` (Linux 5.15+) so the receiver can submit hardlink creation alongside disk writes on the same ring instead of issuing a synchronous `linkat(2)` syscall per hardlinked file. The new `linkat` submodule mirrors the conventions used by `shared_ring::probe_poll_add` and `splice::is_splice_available`: - `LINKAT_MIN_KERNEL = (5, 15)` and `IORING_OP_LINKAT = 39` constants. - `linkat_supported()` short-circuits on `is_io_uring_available()`, builds a throwaway ring, and asks the kernel via `IORING_REGISTER_PROBE` whether opcode 39 is supported. The result is cached in a process-wide `OnceLock`. - `LinkAtArgs<'a>` borrows source/destination `&CStr` paths plus dirfds and `flags` so the compiler enforces the kernel's path lifetime contract. - `build_linkat_sqe` returns `io::ErrorKind::Unsupported` when the probe is `false`; `build_linkat_sqe_unchecked` exposes the encoder for unit tests. - `submit_linkat_blocking` builds a private 2-entry ring, submits the SQE, and returns the kernel's CQE result. The non-Linux stub in `io_uring_stub.rs` provides the same names with `linkat_supported() -> false` and `Unsupported` round-trips. Public re-exports in `crates/fast_io/src/lib.rs` and the Linux `io_uring` module make the API available to consumer crates. Tests: - Unit tests verify `opcode::LinkAt::CODE == 39`, the cached probe is idempotent, the unchecked SQE encoder accepts user_data, and the stub consistently returns `Unsupported`. - `tests/io_uring_linkat.rs` (Linux+`io_uring` feature) submits a real LINKAT, verifies the destination hardlink, and unlinks it; skips when the kernel does not advertise the opcode. * fix(fast_io): use io::Error::other for clippy::io_other_error * fix(fast_io): use c"..." CStr literals to satisfy clippy manual_c_str_literals
3 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
* feat(fast_io): add io_uring LINKAT wrapper and kernel probe Closes #1921, #1923. Adds a typed wrapper around `IORING_OP_LINKAT` (Linux 5.15+) so the receiver can submit hardlink creation alongside disk writes on the same ring instead of issuing a synchronous `linkat(2)` syscall per hardlinked file. The new `linkat` submodule mirrors the conventions used by `shared_ring::probe_poll_add` and `splice::is_splice_available`: - `LINKAT_MIN_KERNEL = (5, 15)` and `IORING_OP_LINKAT = 39` constants. - `linkat_supported()` short-circuits on `is_io_uring_available()`, builds a throwaway ring, and asks the kernel via `IORING_REGISTER_PROBE` whether opcode 39 is supported. The result is cached in a process-wide `OnceLock`. - `LinkAtArgs<'a>` borrows source/destination `&CStr` paths plus dirfds and `flags` so the compiler enforces the kernel's path lifetime contract. - `build_linkat_sqe` returns `io::ErrorKind::Unsupported` when the probe is `false`; `build_linkat_sqe_unchecked` exposes the encoder for unit tests. - `submit_linkat_blocking` builds a private 2-entry ring, submits the SQE, and returns the kernel's CQE result. The non-Linux stub in `io_uring_stub.rs` provides the same names with `linkat_supported() -> false` and `Unsupported` round-trips. Public re-exports in `crates/fast_io/src/lib.rs` and the Linux `io_uring` module make the API available to consumer crates. Tests: - Unit tests verify `opcode::LinkAt::CODE == 39`, the cached probe is idempotent, the unchecked SQE encoder accepts user_data, and the stub consistently returns `Unsupported`. - `tests/io_uring_linkat.rs` (Linux+`io_uring` feature) submits a real LINKAT, verifies the destination hardlink, and unlinks it; skips when the kernel does not advertise the opcode. * fix(fast_io): use io::Error::other for clippy::io_other_error * fix(fast_io): use c"..." CStr literals to satisfy clippy manual_c_str_literals
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Testing
bash tools/ci/run_interop.sh(fails: current oc-rsyncd still rejects--daemon)https://chatgpt.com/codex/tasks/task_e_690951d9cd90832396fc1796dd8da8f1