-
Notifications
You must be signed in to change notification settings - Fork 128
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
Update FUSE kernel ABI #97
Conversation
da76497
to
0d52fc7
Compare
src/kernel.rs
Outdated
pub const FUSE_BIG_WRITES: u32 = 1 << 5; // since ABI 7.9: filesystem can handle write size larger than 4kB | ||
pub const FUSE_DONT_MASK: u32 = 1 << 6; // since ABI 7.12: don't apply umask to file mode on create operations | ||
#[cfg(not(target_os = "macos"))] | ||
pub const FUSE_SPLICE_WRITE: u32 = 1 << 7; // since ABI 7.14: kernel supports splice write on the device |
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.
Splice would be really neat!
src/request.rs
Outdated
unimplemented!() | ||
}, | ||
FUSE_BATCH_FORGET => { | ||
unimplemented!() |
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.
Do you need help with the implementation?
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.
Help would be very welcome of course. I'm just pondering because I'd like to overhaul the overall interface to be more idiomatic and more flexible (especially considering async io) and I don't know if that shouldn't be done first. Batch forget might be more or less easy, but I don't know if I would want the whole notification stuff in the current state
I currently selectively implement some fuse methods as needed by my implementation. |
I also working on a feature-complete passthrough filesystem: https://github.com/Mic92/cntr/blob/master/src/fs.rs |
Do you see any use for this? Mic92@9c53b9f I made libfuse optional, since I needed low-level access to mount stuff across container namespaces. It will also make my project easier to cross-compile. |
Thanks! Making libfuse optional sounds like a nice idea. It would be nice if we could get rid of the libfuse dependency completely one day, but that'd require to reimplement the mount function (which turned out to be more complicated that I thought when I had a look last time). A passthrough filesystem would be a great example but also a great reference for people to see how it works. Plus we could perform benchmarks comparisons of the passthrough vs direct filesystem to determine the FUSE overhead (maybe even compare it to a libfuse implementation to see how it performs) |
I will do benchmarks anyway for my paper in the next two weeks. Implementing mount was easy in my case. The main purpose of fusemount on linux is to have a dedicated setuid wrapper for mount. However in my case I have to start as root anyway for other reasons. |
Batch forget is also now implemented. |
I partly support Fuse API 26, the following is missing: |
Some preliminary performance results from ec2. Performance still sucks since I have not finished multi-threading / splice read/write https://openbenchmarking.org/result/1710208-AL-MERGE427034 Currently the full benchmark suite is running. That discussion might be also of interest: hanwen/go-fuse#192 (comment) |
I have now some optional hacky support for splice read/write. (hacky in the sense that there could be less code duplication) |
I would avoid support for FUSE_POLL. If rust ever gets built-in support for polling file handles (which Go has), this may complicate writing tests. See hanwen/go-fuse#165 |
42f910d
to
ab85b81
Compare
Rebased and updated. After splitting kernel ABI and libfuse FFI stuff into a This should allow us to have at least ABI and FFI definitions for more recent FUSE versions. How different versions can/should be supported in the fuse crate, is however still open. |
In the evaluation part there a performance analysis: https://www.usenix.org/conference/atc18/presentation/thalheim |
I found this thread while looking for docs around implementing notify functions.... any progress on this front? |
I'm also interested on that, specially the new support to mount filesystems by plain users added in Linux 4.18. Is that supported? |
I am using Arch Linux with the 4.19 and soon 4.20 kernel. |
The fuse protocol is versioned and the linux kernel will supports older versions practically for ever. Newer version of the protocol will only add new features, which are then not accessible to the user of this library. |
Since rust-fuse uses fusermount it should be also possible to mount filesystems as unprivileged user. |
Mhm. Rust-fuse still uses the old symbol from fuse2 to mount the filesystem, so I am not sure if the fuse3 unprivileged mode would work. In my fork I removed the need for libfuse when mounting that but I require in my project root for different reason, which is why I did not implement unprivileged mounting with linux namespaces. |
There's ongoing effort to take advantage of a newer ABI and support notify and other functions in #122. About fuse3 unprivileged mode: |
Update to use FUSE kernel ABI 7.19 which opens up the possibility to support more desired features like better optimization, ioctl and polling/notifications. This will raise the requirements to FUSE 2.9.1 or later on Linux and OSXFUSE 3.0.0 or later on macOS.
There are even newer ABI versions, but 7.19 seems to be the one most commonly supported by various systems.