From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu From: Matthew Weigel Message-ID: <9dshfp$3cu$1@cantaloupe.srv.cs.cmu.edu> References: <20010512130225.4B64F199E1@mail.cse.psu.edu> Subject: Re: [9fans] Persistent cache for cfs Date: Wed, 16 May 2001 08:43:23 +0000 Topicbox-Message-UUID: a02e2cf6-eac9-11e9-9e20-41e7f4b1d025 This is my first message here, so bear with me. I don't run Plan 9 for lack of hardware, but I worked on Steve Wynne's systems a little. <9fans@cse.psu.edu> wrote: >What plan 9 could use is a stash, something that stores files >you accessed recently, perhaps picking them up lazily. That way, >you could disconnect and keep working. You'ld still need a >local file system like Unix's root file system because you need >some guaranteed files, or you could just provide a set of files >that the stash absolutely has to have, in addition to what it >caches. It would be a nice and useful project for someone to >do. There was a lot of good work some years ago at Columbia >and other places. No idea where it went. I've been looking at this the last few days, and it seems to me that a nice way to do this would be stacked on top of kfs and fs. A system could be installed onto local disk, and all 'required' files could thus be ensured to be local. If my understanding is correct, stashfs could have visible to itself (or to two cooperating processes, rather, similarly to with Russ Cox's rot13fs) both the fs file tree and the kfs file tree, and the 'upper layer' would show the fs version if connected, and the kfs version if disconnected; for special cases such as files that were edited both locally and on the fs while the client was disconnected could be presented as file.kfs- and file.fs-, so that the user could see both and decide what to do. A simple configuration file could tell stashfs which hierarchies should be completely pulled in (such as a home directory, or the directory of your current projects), and which could not. Before copying a file to the local stash, it could check for sufficient disk space, and if not available, begin deleting least recently modified stashed files first. It should be possible, I think, to have multiple kfs instances serving files from multiple local partitions, right? It seems that it would be much simpler to specify a maximum stash size, and/or have multiple stashes, by creating a partition for each stash. Additionally, if it's left completely up to stashfs to set up the kfs and fs namespaces itself, you could avoid potential weird areas like a client process being able to see the fs or kfs namespace without translation (I'm not entirely clear on whether this would be possible or not). If my understanding looks correct to people, and there aren't issues I'm forgetting to consider, I could begin trying to write this based on Russ Cox's rot13fs. It would be an interesting exercise to see how close I can get without being able to test anything :) -- Matthew Weigel Research Systems Programmer mcweigel+@cs.cmu.edu