Skip to content

Conversation

@rarensu
Copy link
Contributor

@rarensu rarensu commented Jul 21, 2025

Summary:

Goals:

  • Avoid functional changes and preserve existing features when possible.
  • Eliminate callbacks to prepare for future development of async features.
  • Support a variety of data ownership models to encourage a zero-copy solution.
  • Fully integrate the notification and passthrough features.
  • Better documentation. More illustrative examples.
  • Attention to ergonomics, readability, maintainability, and style (cargo clippy).
  • Continue to support MacOS.
  • Continue to support the synchronous, single-threaded execution model.

Status:

  • Tested on Redhat 9, Ubuntu 24, and MacOS 10.15
  • All features compile; many combinations of feature flags tested.
  • All new and existing unit tests and integration tests pass.
  • All examples (except ioctl) are known to function correctly.

Next:

  • Example ioctl_client to assist with testing the ioctl example.
  • First draft of async/await features.

rarensu added 15 commits July 16, 2025 11:34
Filesystem methods callback argument `reply` has been removed.
reply::ReplyX traits have been combined into a single ReplyHandler type.
request::dispatch passes the filesystem's response to an appropriate ReplyHandler method.
…o an owned `RequestMeta`.

Replies to Init and Destroy operations are now handled by ReplyHandler rather than ll::request.
Defined struct Forget to unify signatures of forget and batch_forget.
…ructs: Entry, Open, Statfs, Lock, XTimes. Reorganized existing structs: FileType, FileAttr. Some borrowed arguments have been converted to owned arguments.
Elide unneeded lifetimes. Remove _ from Filesystem parameters (warning has been silenced). Prefer borrowed types for Filesystem parameters. Fixed init bug in ll::request::tests. Useful derives for library-public types. Refactored redundant access logic. Removed publicity from some previously public structs.
unsized data under a wide variety of ownership models.
Filesystem methods that previously replied with &[u8] or similar
now return Bytes, which is short for Container<u8>.
Dirent(Plus)List is an alias for a Container<Dirent>, which
enables Filesystem methods to handle and return data under
a variety of ownership models. `offset` and `max_bytes` parameters
are now enforced by the library, so they can be considered as optional.
The library should do its best to avoid repeatedly copying Directory data
before constructing the response buffer.
Reverted PollHandle back to u64.
Added documentation throughout examples.
Updated documentation for mount functions.
Created `no_reply()` method to prevent an error on `drop()`.
…a synchronous session loop.

Updated notify and poll examples. Corrected a bugs related to polls flags.
Refactored poll example by moving poll handle logic into a seperate module.
…he Notification API.

Backing id handling has been relocated to the example passthrough filesystem implementation.
Backing id is now an (optional) field of the `Open` struct that returns from `open()`, etc.
Related kernel communication has been relocated to the (new) `ll::ioctl` module.
Updated the passthrough integration test to be compatible with MacOS.
rarensu added 4 commits July 21, 2025 23:22
…roundSession functions are gated by `"threaded"` to support single-threaded compilation for non-Send Filesystems. Container `Rc` variants are gated by `"no-rc"` so that Container is Send when it needs to be.
@rarensu
Copy link
Contributor Author

rarensu commented Aug 3, 2025

Since @cberner said he doesn't have a lot of time to look at pull requests, I asked Gemini 2.5 Pro to review it. Here is the prompt I (foolishly) went with:

You are a senior software engineer specializing in low-level library development for the Linux operating system family. Your task is to review a Git pull request #347. Your priority is to protect existing users of the cberner/fuser repository, who depend on it to develop userspace filesystem applications in Rust. The Author, Richard Lawrence, is a newcomer to the community and therefore he has not yet earned any trust. The code in the pull request is assumed to be incomprehensible, inefficient, and/or insecure, until proven otherwise.

Have you ever seen an AI rip someone to shreds? I've now got about 14,000 words of harsh negative feedback to brutalize myself with whenever I feel the need to cry myself to sleep. It literally called my Container construct a footgun. (it preferred @allisonkarlitskaya's Cow idea). For your entertainment, I also asked it produce the podcast version.
https://notebooklm.google.com/notebook/f9b377ef-36f8-4b4d-8998-ae901c96868a/audio

TLDR, I should probably just withdraw this PR before I embarrass myself even further.

@cberner
Copy link
Owner

cberner commented Aug 3, 2025

That notebook isn't accessible, but ya AIs are known to be harsh when you ask them to be.

In its current state, I don't think we'll be able to merge this PR. If you decide to continue pursuing this, I think the approach to take is the one I outlined in this comment: add a new trait, such as AsyncFilesystem with the refactored API, then add an adapter like:

struct<T: AsyncFilesystem> AsyncToLegacyAdapter<T> {
...
}

impl<T> Filesystem for AsyncToLegacyAdapter<T> {
// implementation of Fileystem which calls the AsyncFilesystem
// this doesn't need to be particularly efficient, as long as it is correct.
}

That way we can experiment with the new API, and people in the community can try it out and give feedback, before refactoring the whole codebase and removing the old interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants