-
Notifications
You must be signed in to change notification settings - Fork 87
feat(driver,poll): wait 2 fds for 1 op #617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for operations that need to wait on two file descriptors simultaneously, specifically enabling the splice system call to properly wait for both the input fd (readable) and output fd (writable) before executing. This addresses the requirements of #608 for implementing zero-copy file splicing.
- Introduces
Decision::Wait2andOpType::Fd2to handle operations polling two file descriptors - Updates the
Spliceoperation to wait on both input and output fds instead of only the input fd - Refactors the polling and cancellation logic to support two-fd operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| compio-driver/src/sys/poll/op.rs | Updates Splice OpCode implementation to wait for both input and output fds, and refactors the operate method to use the syscall! macro consistently |
| compio-driver/src/sys/poll/mod.rs | Adds Decision::Wait2 and OpType::Fd2 variants, introduces helper method poll_fd to handle fd polling, and updates cancel and poll methods to support two-fd operations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
What about we unify them into one |
|
If we meet a case that needs to wait for 3 fds in the future, that should be correct time to unify them, I think:) |
Okay.. what about an |
|
Also please add a test for two fd scenario |
|
Too hard for me to handle multiple coming events. Help wanted. |
d7f3fcc to
f4f535a
Compare
Would benefit #608