Initialize the newer core filesystem design#887
Conversation
1fbc7ce to
0bea5df
Compare
4189660 to
89cd30b
Compare
| let read_allowed = access_mode == OFlags::RDONLY || access_mode == OFlags::RDWR; | ||
| let write_allowed = access_mode == OFlags::WRONLY || access_mode == OFlags::RDWR; |
There was a problem hiding this comment.
Do we need to check if the user has the read or write permission before we say it's allowed?
There was a problem hiding this comment.
Thanks Weidong, when improving this, I realized I could improve the whole walking situation a bit more, and simplify open itself, making it much cleaner and easier to work with. The latest version has that nicer design, and the user permission checking is included (and the type system will remind us now).
There was a problem hiding this comment.
Do we need to check executable permission at some place?
There was a problem hiding this comment.
For files, executable permissions don't quite matter when opening, it only matters if you are trying to execveing or similar, so it would that the shim's job to use fd_file_status or similar.
wdcui
left a comment
There was a problem hiding this comment.
Thank you for staring this sequence of PRs to improve the fs code. I left a couple of comments below.
89cd30b to
76ff35d
Compare
76ff35d to
7cd8d12
Compare
|
🤖 SemverChecks 🤖 Click for details |
wdcui
left a comment
There was a problem hiding this comment.
LGTM. I left a couple of minor comments. Thanks.
| rdev: core::num::NonZeroUsize::new(0x109), | ||
| }; | ||
| #[derive(Debug, Clone, Copy)] | ||
|
|
There was a problem hiding this comment.
Nit: Do we want to add this empty line?
There was a problem hiding this comment.
It was weird for the enum to be sitting right up against the existing consts from a grouping perspective, so I had added a newline here.
| let read_allowed = access_mode == OFlags::RDONLY || access_mode == OFlags::RDWR; | ||
| let write_allowed = access_mode == OFlags::WRONLY || access_mode == OFlags::RDWR; |
There was a problem hiding this comment.
Do we need to check executable permission at some place?
|
GPT-5.5 found the following issues. You can decide if they should be addressed in this PR.
|
jaybosamiya-ms
left a comment
There was a problem hiding this comment.
Thanks Weidong! For the GPT-5.5 discovered issues:
- I already have an existing TODO to account for this in a future PR (GPT-5.5 even recognizes that I have a TODO for it); I did not want to block this PR on figuring out this currently-unobservable detail.
- Does not apply right now, because I've only migrated the devices file system which is read-only; it is a hazard, and will be handled in future PRs with mutable file systems.
unimplemented!()is an explicit signal of "we will implement this later", the panic there is intentionally indicating "we need to solve this in a future PR"- This is a known issue due to the ongoing migration of the different backends, will be resolved in future PRs (there are technically even more collisions possible due to the
STDIO_NODE_INFOand such constants), yes the inode allocation needs improvement to make consistent throughout the codebase, but that will come as one of the last few PRs in the series, because it needs coordination across all backends (that's why I'm migrating everything over to the inode allocator design that this PR introduces).
| let read_allowed = access_mode == OFlags::RDONLY || access_mode == OFlags::RDWR; | ||
| let write_allowed = access_mode == OFlags::WRONLY || access_mode == OFlags::RDWR; |
There was a problem hiding this comment.
For files, executable permissions don't quite matter when opening, it only matters if you are trying to execveing or similar, so it would that the shim's job to use fd_file_status or similar.
| rdev: core::num::NonZeroUsize::new(0x109), | ||
| }; | ||
| #[derive(Debug, Clone, Copy)] | ||
|
|
There was a problem hiding this comment.
It was weird for the enum to be sitting right up against the existing consts from a grouping perspective, so I had added a newline here.
|
In prep for the next PR in the series, I've discovered that it may be helpful to slightly tweak the new |
This PR introduces some of the key components the new filesystem design. Concretely, it sets up a new
Backendabstraction, which is used by theResolverto provide aFileSystem. This PR itself is part 1 of the changes towards this new file system design. For now, I have only migrated the devices sub-filesystem over to the new model.Few points of interest:
unimplemented!s in it along the way/devshowing up