#4 cachefs


This implements a caching filesystem.

Use it like so:

lufsd none /path/to/mount/point -o

(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/


  • Timothee Besset

    Timothee Besset - 2003-01-14


  • Timothee Besset

    Timothee Besset - 2003-01-14

    additional files in lufsd/cachefs

  • Florin Malita

    Florin Malita - 2003-01-25
    • status: open --> open-accepted
  • Florin Malita

    Florin Malita - 2003-01-25

    Logged In: YES

    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.

  • Wout Mertens

    Wout Mertens - 2003-04-15

    Logged In: YES

    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

    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.


  • Timothee Besset

    Timothee Besset - 2003-04-15

    Logged In: YES

    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 :-)

  • Wout Mertens

    Wout Mertens - 2003-04-16

    Logged In: YES

    Sounds fair. mali, can you tell me what changes are needed
    in the code for the new framework?


  • Timothee Besset

    Timothee Besset - 2003-04-21

    Logged In: YES

    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.

  • Timothee Besset

    Timothee Besset - 2003-06-03

    Logged In: YES

    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:


    This is still experimental and work-in-progress.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks