You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While expanding readlink / readlinkat, I noticed that we often repeat similar conversion logic in multiple places within fs_calls and net_calls. This includes conversions between user-view paths and host kernel paths, as well as between virtual file descriptors and kernel file descriptors. Simplifying this process with reusable helper functions could make the codebase cleaner and easier to maintain.
Currently, the conversion logic is scattered and duplicated across various parts of fs_calls and net_calls. By consolidating this logic into well-designed helper functions, we can reduce redundancy, improve code clarity, and streamline future development. Additionally, this task provides a great entry point for new contributors to understand the project structure.
The text was updated successfully, but these errors were encountered:
Thanks to Matt for pointing out this issue during the code review!
In current RawPOSIX design, let relative_path = relpath.to_str().unwrap(); would panic if the path variable containing non-utf-8 characters. To avoid this, we should implement a better error handling (e.g., using return EINVAL instead of .unwrap()), which I think could be done in our following refactor.
I think it would be good to combine removing filesystem.rs into whatever this PR becomes. Most of that has been stripped from the RustPOSIX days and now is only like 2 tools for path conversions.
While expanding
readlink
/readlinkat
, I noticed that we often repeat similar conversion logic in multiple places within fs_calls and net_calls. This includes conversions between user-view paths and host kernel paths, as well as between virtual file descriptors and kernel file descriptors. Simplifying this process with reusable helper functions could make the codebase cleaner and easier to maintain.Currently, the conversion logic is scattered and duplicated across various parts of fs_calls and net_calls. By consolidating this logic into well-designed helper functions, we can reduce redundancy, improve code clarity, and streamline future development. Additionally, this task provides a great entry point for new contributors to understand the project structure.
The text was updated successfully, but these errors were encountered: