-
Notifications
You must be signed in to change notification settings - Fork 19
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
Rust FS STD interface extension #206
Conversation
I accidentally closed it while trying to merge changes from Twizzler main to my local main. But since the library changes are in effect, this should play nicer with the rust branch I'm pointing towards now. Though I'm still waiting for my Rust changes to be reviewed so I can point it towards the Rust/Twizzler branch. |
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.
LGTM
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.
LGTM
There is a feature and a fix to the filesystem and one to Xtask.
The first is extensible files and a lazy loaded LRU cache. So this will automatically create new objects to write past a single object boundary. I also made the maximum size of each object written to 64 megabytes. The reasoning for this is that Twizzler runs out of memory when I write 1.5 objects. So that's where my cache comes in. I will map and unmap files based on usage so that it can write more than the capacity of the system ram.
I also made a fix to the rust library. Before I just used a simple integer to represent a file descriptor. However this is flawed since a file descriptor can be dropped when moved. So I copied over the RawFd and OwnedFd structs from os/fd.rs since this will manage when the file descriptor is dropped therefore not leaking any memory or dropping the fd prematurely.
Finally I add a slight modification to Xtask so that objects can be moved onto the initrd. There is a folder you can add to src/data and it will rsync this to target//debug directory. This allows more ergonomic testing since now files put into twizzler can be interfaced by the filesystem API.