cachefs
Status: Beta
Brought to you by:
mali
This implements a caching filesystem.
Use it like so:
lufsd none /path/to/mount/point -o
fs=cachefs,root=/path/to/root,reference=/path/to/reference
(the number of options is not compatible with lufsmount)
by default it will look for stuff in root/, and if the
file is not found it will look in reference/. If found
in reference it will copy over to root/
patch
additional files in lufsd/cachefs
Logged In: YES
user_id=154306
excellent, i will include it as soon as i get a chance to adapt it to the new framework. the cvs is messed up, maybe you can take a look at the description in interrupted syscalls patch and give me some advice.
Logged In: YES
user_id=238228
This is very nice!
I'm looking at it currently to see if it would be easy to adapt it to make it an
overlay filesystem, but mali says that it is not adapted to the current
framework :-/. What does that mean? Is any work being done on this?
With overlay fs I mean the ability to write to a readonly filesystem such as a
cd or an nfs mounted root. This would make e.g. netbooting systems a lot
easier.
Anyway, this is the theory:
- You have two filesystems, master (M) and overlay (O)
- They are combined, with the contents of O having priority. O contains
special metadata explaining that the stats of a file changed, the file renamed
or the file deleted.
- For choosing between caching or transparant overlaying, you choose the
read and write strategy: copy on read/copy on write. Copy on read would
do caching, copy on write would make an overlay filesystem. Here copy
means from M to O.
- Then you choose your writeback method: Caching can be done with
synchronous writes and asynchronous writes, overlays would disable writes.
Here writes means that something changed and you write it to O, and you
optionally write it to M.
- Also, you must choose if O is always right, or only if the timestamp on the
file in M is older.
To do this, metadata must be kept in O. To make use of the kernel inode
cache, I propose using a .lufs_metadata directory in all the directories of O
where they are necessary. In that directory, you have the subdirectories
'deleted', 'newstats' and 'linked'. In deleted, you put the filenames of the files
that are deleted; in newstats, you just touch filenames with the new stats,
and in 'linked', you put symlinks to the files that they are hardlinked to.
Using C++, this is easier to do than in C thanks to the container classes.
Thoughts?
Logged In: YES
user_id=2063
yes, overlay or cachefs ..
I think your description matches what I had initially
designed. This patch was written before mali reorganized the
framework, it's likely that it can't be used as-is anymore.
I don't mind if you want to re-use parts of this code into
your own overlay implementation though.
I still use lufs a lot (mostly ftp), but I don't have the
need for an overlay. So I don't plan on updating/finalizing
this cachefs stuff really. If you start writing an overlay
yourself though, I'd be interested in looking at the code
and testing it a bit with you. Who knows, might still find
some usefulness to it later :-)
Logged In: YES
user_id=238228
Sounds fair. mali, can you tell me what changes are needed
in the code for the new framework?
Thanks!
Logged In: YES
user_id=2063
Actually I might have some usage for cachefs and similar
functionalities soon for some research work. So I might try
to update the code. I don't know what needs to be done
really. A rewrite from scratch with a few cut and paste from
the old code is likely.
You should be able to reach me on #lufs on irc.freenode.net
when I'm online. Should be back to work later this week.
Logged In: YES
user_id=2063
I wrote cachefs and changefs as part of YAM. Just turned the
repository public. The lufs filesystems I am writing for YAM
are available there:
https://zerowing.idsoftware.com:666/yam-web/index.html
This is still experimental and work-in-progress.