refactor(driver): adjust sys layout#870
Merged
George-Miao merged 1 commit intoApr 16, 2026
Merged
Conversation
dc1ab39 to
0d8530c
Compare
efcf18e to
eb7424d
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors compio-driver’s sys module layout by extracting platform abstractions into sys::pal, reorganizing driver backends under sys::driver, and regrouping low-level operations under sys::op (including new socket/zerocopy/multishot op modules).
Changes:
- Introduces
sys::pal(unix/windows) for platform-specific types/utilities and re-exports them throughsys. - Restructures backend drivers into
sys::driver::{iour,poll,iocp,fusion,stub}and moves backend-specific “extra” types intosys::extra. - Reorganizes and adds low-level op implementations under
sys::op(general/fs/socket/managed/multishot/zerocopy/asyncify) with fusion wiring via a newfuse_op!macro.
Reviewed changes
Copilot reviewed 77 out of 83 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| compio-driver/src/sys/sys_slice.rs | Refactors platform-specific slice ABI handling via cfg_if. |
| compio-driver/src/sys/pal/mod.rs | New platform abstraction entry point (unix/windows). |
| compio-driver/src/sys/pal/unix/mod.rs | New Unix PAL exports (fd types, libc helpers, io_uring probe, etc.). |
| compio-driver/src/sys/pal/windows/mod.rs | New Windows PAL utilities (OVERLAPPED wrapper, results helpers, cancel, WSA fn lookup). |
| compio-driver/src/sys/pal/windows/fd.rs | Windows fd/handle/socket type layer and AsFd/AsRawFd abstractions. |
| compio-driver/src/sys/op/mod.rs | New centralized op module with submodules and unix-only re-exports. |
| compio-driver/src/sys/op/asyncify/mod.rs | New asyncify op module wiring per-backend implementations. |
| compio-driver/src/sys/op/asyncify/poll.rs | Polling backend impls for asyncify operations. |
| compio-driver/src/sys/op/asyncify/iour.rs | io_uring backend impls for asyncify operations. |
| compio-driver/src/sys/op/asyncify/iocp.rs | IOCP backend impls for asyncify operations. |
| compio-driver/src/sys/op/asyncify/stub.rs | Stub backend impls for asyncify operations. |
| compio-driver/src/sys/op/ext.rs | Adds extension traits for taking/advancing buffers and mapping recv results. |
| compio-driver/src/sys/op/flag.rs | Adds OpCodeFlag bitflags for opcode support detection. |
| compio-driver/src/sys/op/general/mod.rs | New “general” ops module (read/write/at variants). |
| compio-driver/src/sys/op/general/poll.rs | Polling backend implementation for general ops. |
| compio-driver/src/sys/op/general/iour.rs | io_uring backend implementation for general ops. |
| compio-driver/src/sys/op/general/iocp.rs | IOCP backend implementation for general ops (incl. device ioctl, named pipe connect). |
| compio-driver/src/sys/op/general/stub.rs | Stub backend implementations for general ops. |
| compio-driver/src/sys/op/fs/mod.rs | New filesystem ops module and backend selection. |
| compio-driver/src/sys/op/fs/poll.rs | Polling backend filesystem ops (stat, sync, mkdir, unlink, etc.). |
| compio-driver/src/sys/op/fs/iour.rs | io_uring backend filesystem ops (openat/close/ftruncate/statx). |
| compio-driver/src/sys/op/fs/fusion.rs | Fusion wrapper exports for fs ops. |
| compio-driver/src/sys/op/fs/stub.rs | Stub backend filesystem ops. |
| compio-driver/src/sys/op/managed/mod.rs | New managed-buffer ops module selection per backend. |
| compio-driver/src/sys/op/managed/poll.rs | Polling backend wrappers for managed ops. |
| compio-driver/src/sys/op/managed/iour.rs | io_uring backend managed ops tweaks + doc(hidden) controls. |
| compio-driver/src/sys/op/managed/iocp.rs | IOCP backend wrappers for managed ops. |
| compio-driver/src/sys/op/managed/stub.rs | Stub backend wrappers for managed ops. |
| compio-driver/src/sys/op/managed/fallback.rs | Adjusts fallback imports to use sys::op ops. |
| compio-driver/src/sys/op/managed/fusion.rs | Refactors fused managed ops implementation to use new layout. |
| compio-driver/src/sys/op/multishot/mod.rs | New multishot ops module selection and fusion glue. |
| compio-driver/src/sys/op/multishot/iour.rs | io_uring multishot accept implementation. |
| compio-driver/src/sys/op/multishot/poll.rs | Polling multishot accept wrapper over Accept. |
| compio-driver/src/sys/op/multishot/stub.rs | Stub multishot accept placeholder. |
| compio-driver/src/sys/op/socket/mod.rs | New socket ops module definitions and backend selection. |
| compio-driver/src/sys/op/socket/unix.rs | Unix socket control structs + libc call helpers for socket ops. |
| compio-driver/src/sys/op/socket/iour.rs | io_uring backend socket op implementations. |
| compio-driver/src/sys/op/socket/stub.rs | Stub backend socket op implementations. |
| compio-driver/src/sys/op/zerocopy/mod.rs | New zerocopy ops module selection (fusion/iour/fallback). |
| compio-driver/src/sys/op/zerocopy/iour.rs | io_uring zerocopy send/sendmsg variants with multishot handling. |
| compio-driver/src/sys/op/zerocopy/fusion.rs | Fusion wrapper exports for zerocopy ops. |
| compio-driver/src/sys/op/zerocopy/fallback.rs | Fallback aliases mapping ZC ops to non-ZC equivalents. |
| compio-driver/src/sys/mod.rs | Reorganizes sys module (adds driver, pal, op, sys_slice, prelude). |
| compio-driver/src/sys/extra/mod.rs | Refactors “extra” to be per-backend module + adds Extra::new(&Driver). |
| compio-driver/src/sys/extra/poll.rs | Adjusts polling extra visibility + alias export. |
| compio-driver/src/sys/extra/iour.rs | Adds alias export for iour extra. |
| compio-driver/src/sys/extra/fusion.rs | Refactors fusion extra enum + alias exports. |
| compio-driver/src/sys/extra/iocp.rs | New IOCP extra wrapper around Overlapped. |
| compio-driver/src/sys/extra/stub.rs | New stub extra type. |
| compio-driver/src/sys/driver/mod.rs | New driver selection module (iocp/fusion/iour/poll/stub). |
| compio-driver/src/sys/driver/poll/mod.rs | Poll driver refactor; moves op traits/types into poll/op.rs. |
| compio-driver/src/sys/driver/poll/op.rs | New polling OpCode trait/types (Decision/OpType/WaitArg). |
| compio-driver/src/sys/driver/iour/mod.rs | io_uring driver refactor; factors out op + notifier; adjusts extra creation. |
| compio-driver/src/sys/driver/iour/op.rs | New io_uring OpCode trait + OpEntry + carry glue. |
| compio-driver/src/sys/driver/iour/notify.rs | New io_uring notifier/waker implementation. |
| compio-driver/src/sys/driver/iocp/mod.rs | IOCP driver refactor; moves overlapped/extra handling into PAL/extra. |
| compio-driver/src/sys/driver/iocp/wait/mod.rs | New IOCP wait backend selection (wait packet vs threadpool). |
| compio-driver/src/sys/driver/iocp/wait/packet.rs | IOCP wait implementation using Nt*WaitCompletionPacket. |
| compio-driver/src/sys/driver/iocp/wait/thread_pool.rs | IOCP wait implementation using Win threadpool waits. |
| compio-driver/src/sys/driver/iocp/cp/mod.rs | New IOCP completion-port abstraction (global vs per-thread). |
| compio-driver/src/sys/driver/iocp/cp/multi.rs | IOCP-per-thread completion port wrapper. |
| compio-driver/src/sys/driver/iocp/cp/global.rs | Global IOCP completion port adjustments to use sys prelude. |
| compio-driver/src/sys/driver/fusion/mod.rs | Fusion driver refactor and re-exports; uses new FuseExtra. |
| compio-driver/src/sys/driver/fusion/op.rs | New fusion OpCode marker trait + carry dispatch based on Extra. |
| compio-driver/src/sys/driver/stub/mod.rs | Stub driver updated to use new sys::extra::StubExtra and prelude. |
| compio-driver/src/sys/buffer_pool/mod.rs | Buffer pool control refactor; adds fusion/iour/fallback modules. |
| compio-driver/src/sys/buffer_pool/iour.rs | Updates buffer-ring registration API to work via crate::Driver and iour accessor. |
| compio-driver/src/sys/buffer_pool/fusion.rs | Fusion buffer pool control dispatch based on driver.as_iour(). |
| compio-driver/src/sys/buffer_pool/fallback.rs | New fallback buffer pool control implementation. |
| compio-driver/src/macros.rs | Adds fuse_op! macro for generating fused ops and refactors macro exports. |
| compio-driver/src/lib.rs | Re-exports sys::op at crate root; routes default_extra() through new Extra::new. |
| compio-driver/build.rs | Updates cfg aliases; adds stub alias and refines polling alias. |
| compio-driver/Cargo.toml | Adds mod_use dependency. |
| .gitignore | Normalizes ignore patterns for editor/direnv files. |
Comments suppressed due to low confidence (2)
compio-driver/src/sys/sys_slice.rs:31
- In the
cfg_iffallback (else) branch,newtakes*mut MaybeUninit<u8>butMaybeUninitis not in scope in that branch. This will fail to compile on targets that are neitherunixnorwindows. Importstd::mem::MaybeUninitin theelsebranch or fully-qualify it in the signature.
compio-driver/src/sys/sys_slice.rs:90 SysSlice::ptr/lenonly have#[cfg(unix)]and#[cfg(windows)]returns; on any other target the function body becomes empty and won’t compile. If non-unix/windows targets are intentionally unsupported, gate the entire type/impl with#[cfg(any(unix, windows))]; otherwise add an explicit#[cfg(not(any(unix, windows)))]branch (e.g.,unreachable!()or a dummy return).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Berrysoft
requested changes
Apr 16, 2026
eb7424d to
ff57032
Compare
ff57032 to
396c2a3
Compare
Member
|
Let's wait for CI a while... |
Member
Author
|
Wait a sec. I still need to change a little. |
396c2a3 to
0dcece2
Compare
Berrysoft
approved these changes
Apr 16, 2026
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.
No description provided.