ITADN

Investigate adding support for erofs

#14Openchenxiaolong 创建于 2025-02-17
C
chenxiaolongcommented
I started working on a proof-of-concept implementation for erofs support this weekend and I currently don't plan to work on it any further. Although erofs-utils is split into `lib` and `fuse`/`mkfs`/`fsck` components, the "library" part isn't really usable as a library. * The library components rely on `cfg` and `g_sbi` global variables, which are tied to a specific open file. This makes it impossible to operate on more than one erofs image at the same time. EDIT(2025-05-10): There are a lot more `static struct`s in `lib/` than I originally thought. If we use it, we'll probably just need to use a global lock to prevent opening more than one filesystem at a time. * Although erofs-utils can compile without including `linux/*.h` headers, it still depends on Linux-specific behavior. For example, it uses libc's `S_IFREG`/`S_IFDIR`/... and `makedev`/`major`/`minor` directly when interacting with filesystem structures. This will fail to compile on Windows and silently do the wrong thing on macOS (where eg. `makedev` composes the major and minor values differently from Linux). e2fsprogs doesn't have this problem because it defines its own constants and macros for anything that's Linux-specific. * The library components use application-style logging that are hardcoded to dump the messages into stdout/stderr instead of returning them as part of some error type. It's not really feasible to integrate erofs-utils with afsr. There is a new Rust implementation of erofs that seems promising, though it's not complete yet: https://github.com/ToolmanP/erofs-rs.
6 条评论