add the module structure to src/op.rs#241
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #241 +/- ##
==========================================
- Coverage 37.36% 35.67% -1.70%
==========================================
Files 14 25 +11
Lines 2676 2803 +127
Branches 2676 2803 +127
==========================================
Hits 1000 1000
- Misses 1628 1755 +127
Partials 48 48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
Refactor to modularize src/op.rs by splitting operations into dedicated modules and implementing a shared decoding mechanism.
- Split monolithic op.rs into focused modules (attr, file, dir, inode, lock, xattr, etc.)
- Introduced Context and an Op trait to delegate request decoding per module
- Re-exported key operation types from op.rs to preserve the external API surface
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/op.rs | Central dispatcher updated to use Context and Op::decode; re-exports added for module types. |
| src/op/attr.rs | Added Getattr/Setattr and SetAttrTime with decode implementations. |
| src/op/file.rs | Added file-related ops (Open/Read/Write/etc.), flags, and OpenOptions with decode implementations. |
| src/op/dir.rs | Added directory ops (Opendir/Readdir/etc.) with decode implementations. |
| src/op/inode.rs | Added inode-related ops (Lookup/Mknod/Mkdir/Rename/etc.) and RenameFlags. |
| src/op/lock.rs | Added Getlk/Setlk/Flock and SetlkKind decoder. |
| src/op/xattr.rs | Added xattr ops (Setxattr/Getxattr/Listxattr/Removexattr). |
| src/op/forget.rs | Added Forgets/Forget and batch/single decode. |
| src/op/notify_reply.rs | Added NotifyReply decode. |
| src/op/copy_file_range.rs | Added CopyFileRange decode. |
| src/op/create.rs | Added Create op with doc links. |
Comments suppressed due to low confidence (1)
src/op/inode.rs:1
- Corrected wording in the documentation.
use crate::types::{DeviceID, FileMode, FilePermissions, NodeID};
| pub use attr::{Getattr, SetAttrTime, Setattr}; | ||
| pub use copy_file_range::CopyFileRange; | ||
| pub use create::Create; | ||
| pub use dir::{Fsyncdir, Opendir, Readdir, ReaddirMode, Releasedir}; | ||
| pub use file::{ | ||
| AccessMode, Fallocate, Flush, Fsync, Lseek, Open, OpenFlags, OpenOptions, Poll, Read, Release, | ||
| ReleaseFlags, Write, | ||
| }; | ||
| pub use forget::{Forget, Forgets}; | ||
| pub use inode::{ | ||
| Access, Bmap, Link, Lookup, Mkdir, Mknod, Readlink, Rename, Rmdir, Statfs, Symlink, Unlink, | ||
| }; | ||
| pub use interrupt::Interrupt; | ||
| pub use lock::{Flock, FlockOp, Getlk, Setlk}; | ||
| pub use notify_reply::NotifyReply; | ||
| pub use xattr::{Getxattr, Listxattr, Removexattr, Setxattr, SetxattrFlags}; |
There was a problem hiding this comment.
Types used in public struct fields are not re-exported, resulting in private types in the public API. Specifically, Rename.flags uses RenameFlags, Fallocate.mode uses FallocateFlags, and Lseek.whence uses Whence, but these types are not re-exported from op.rs. Re-export them to avoid E0446 and keep the API stable. For example: add RenameFlags to the inode re-exports, and FallocateFlags and Whence to the file re-exports.
| @@ -0,0 +1,149 @@ | |||
| use polyfuse_kernel::{fuse_lk_in, fuse_opcode, FUSE_LK_FLOCK}; | |||
| use rustix::thread::Pid; | |||
There was a problem hiding this comment.
Pid is provided by rustix::process in current rustix releases; using rustix::thread::Pid will fail to compile. Replace with rustix::process::Pid to match the rest of the codebase and the API used elsewhere.
| use rustix::thread::Pid; | |
| use rustix::process::Pid; |
| /// See also [`Mknod::parent`]. | ||
| pub parent: NodeID, | ||
|
|
||
| /// The file name to crate. |
There was a problem hiding this comment.
Corrected spelling in the documentation.
| /// The file name to crate. | |
| /// The file name to create. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #241 +/- ##
==========================================
- Coverage 37.36% 35.67% -1.70%
==========================================
Files 14 25 +11
Lines 2676 2803 +127
Branches 2676 2803 +127
==========================================
Hits 1000 1000
- Misses 1628 1755 +127
Partials 48 48 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.