Re: cachefs module for linux?

Jeff Garzik (jgarzik@pobox.com)
Thu, 10 Jun 1999 13:28:02 -0400 (EDT)


On 10 Jun 1999, Stefan Monnier wrote:
> Anyway, going back to CacheFS, obviously some people would like to have such a
> thing, but obviously also, none of them needs it badly enough that she's
> willing to write it... so the discussion is mostly pointless.

Straw poll... what would be a good way to implement this?

My idea... Implement cachefs with semantics similar to that of swap
files and partitions.

Usage -- In the generic VFS routines, add a check upon file open() to
see if it is backed by a local CacheFS cache. This could be a flag set
in the superblock.

When each file read occurs, if the cached flag is set on that inode,
then try to read from the local CacheFS. If the read fails, or the file
is not cached, normal file read occurs.

Adding hooks in the generic VFS should make it possible to cache any
filesystem easily.

Another option is an NFS-style daemon that presents a new filesystem
tree as a cached representation of an existing filesystem tree.

For example, your userland programs expect the company files to be under
'/remote/export'. you mount an NFS filesystem:

mount -t nfs server:/export /remote/uncached/export

Then you mount cachefs (uses cachefsd, an nfsd-style userland daemon)

mount -t cachefs /remote/uncached/export /remote/export

The second option sounds easier and cleaner, but slower (more data copies).
Maybe combine the two... Use the second approach in a kernel daemon,
'kcachefsd'.

Comments?

Jeff

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/