-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Defining a drop file system as a read only pass through file system that silently ignores write operations.
My plan is for open read, we'd do the open and forward the reads. For create / write we open behave like /dev/null
For read directory, if the directory exists read it normally
Otherwise treat it like an empty directory.
Reading and writing to a file descriptor that doesn't exist is undefined thinking that it does not throw an error, instead behaves like /dev/null unless it's faster to throw an error.
Getting information for files the don't exist Acts like /dev/null
Would be a lot easier if pass through was a trait with default imitation that actually does pass through.
I was thinking I would be to have a pass through in my struct and forward valid operations and mask failures. Also always disable write caching. My understanding is that their is only one trait I need to implement and that's BackendFileSystem or FileSystem
I was looking at the pass through file system defined here, as well as https://github.com/libfuse/libfuse/blob/master/example/passthrough_hp.cc My understanding is that passthrough_hp.cc doesn't do any unnecessary copies.
- Does the pass through do unnecessary copies?
- Do I always need synchronous io?
- Is there anything like memory mapping that I have to worry about? I really don't want the user to be able to write to the underlying FS under any circumstance.
- Should I disable write cashing?
- Would it be more performant to implement a black hole (acts acts like an empty directory and ignores all write and creation) and then set up an overlay?
- BackendFileSystem vs FileSystem