A Re-Implementation Of The EROFS File-System In Rust Has Started
The EROFS read-only open-source file-system has seen initial patches posted today for beginning to re-implement the C code within the Rust programming language for better safety guarantees and the possibility of more performance optimizations.
So far the state of Rust support for file-system drivers on Linux remains in early form. There has been some work like writing an EXT2 driver in Rust but so far no Rust VFS implementation is upstreamed and no big drivers have yet seen a complete transition to Rust.
Yiyang Wu posted the patches today that begin adding Rust code to the EROFS file-system implementation. The Rust code is inspired by the C code but so far it's very limited. Yiyang Wu commented:
But the early state of Rust support for Linux storage/file-system drivers does lead to some early adoption issues:
Those interested in this effort and the 3k lines of Rust code so far for beginning to re-implement EROFS in Rust can see this RFC patch series laying out the initial work.
So far the state of Rust support for file-system drivers on Linux remains in early form. There has been some work like writing an EXT2 driver in Rust but so far no Rust VFS implementation is upstreamed and no big drivers have yet seen a complete transition to Rust.
Yiyang Wu posted the patches today that begin adding Rust code to the EROFS file-system implementation. The Rust code is inspired by the C code but so far it's very limited. Yiyang Wu commented:
"So here is a patchset to add Rust skeleton codes to the current EROFS implementation. The implementation is deeply inspired by the current C implementation, and it's based on a generic erofs_sys crate written by me. The purpose is to potentially replace some of C codes to make to make full use of Rust's safety features and better optimization guarantees.
Many of the features (like compression inodes) still fall back to C implementation because of my limited time and lack of Rust counterparts. However, the Extended Attributes work purely in Rust."
But the early state of Rust support for Linux storage/file-system drivers does lead to some early adoption issues:
"Note that, since currently there is no mature Rust VFS implementation landed upstream, this patchset only uses C bindings internally and each unsafe operation is examined. This implementation only offers C-ABI-compatible functions impls and gets its exposed to original C implementation as either hooks or function pointers.
Also note that, this patchset only uses already-present self-included EROFS API and it uses as few C bindings generated from bindgen as possible, only inode, dentry, file and dir_context related are used, to be precise."
Those interested in this effort and the 3k lines of Rust code so far for beginning to re-implement EROFS in Rust can see this RFC patch series laying out the initial work.
62 Comments