From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Date: Thu, 13 Nov 2008 11:37:02 -0500 From: "Dan Cross" To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net> In-Reply-To: <4506d967646c9cd2dd052fb9f5356c7f@plan9.bell-labs.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <5d375e920811121100o15702c64ufb6e367220606058@mail.gmail.com> <4506d967646c9cd2dd052fb9f5356c7f@plan9.bell-labs.com> Subject: Re: [9fans] Do we have a catalog of 9P servers? Topicbox-Message-UUID: 411e2224-ead4-11e9-9d60-3106f5b1d025 On Wed, Nov 12, 2008 at 2:13 PM, wrote: > stat(5) specifies exclusive-access files, which we do use for locking. > In what sense is that not `doing locking'? It's not POSIX byte-range > read- or write-locking per fcntl, but it's not clear to me how often > that's actually useful. In quite a few situations, having a single > process directly access a resource and forcing all other accesses > through that process suffices. For special purposes, the canonical solution is probably just to have a ctl file that accepts commands to manipulate locks. It's a bit of a protocol dance in the sense of the calling program having some smarts about what order it does things in, but wouldn't require changes to 9P proper. I recall when we were talking about adding a Tflush message around the time of 9P2000 and Rob or Russ or someone saying, "that's really the job of a fileserver." I didn't fully appreciate what they meant at that time, thinking solely in terms of disk-based "file servers" (instead of the more abstract notion of a fileserver as a collection of related resources with well-defined operations on them) like kenfs, but it dawned on me (much) later that they were just referring to some sort of ctl file and a command along the lines of "sync ". Locking is a natural abstraction of that kind of thing; it could easily be abstracted into a library function that does the right thing, much as dial() does. The one change I wish we could make to 9P is to extend stat and wstat with a version field, so I could pass domain specific information over 9P. As a stupid example, combining that with some sort of translator, I could define a DECnet service that let me manipulate all the VMS and TOPS-20 specific fields and extended file attributes from those worlds, but from Plan 9. All of a sudden, I have access to a versioned filesystem living under VMS on Itanium. Not that anyone would WANT to do such a thing, but it was a simple example that just popped into my head. Perhaps a more realistic idea would be assuming the functionality of the 9P2000.u protocol (which I don't know much about; the Marines have been keeping me away from Plan 9 for quite some time now, but as I understand it, it mainly extends 9P to deal with symlinks for Unix support). I can't really think of anything you couldn't do with that change and an appropriately designed ctl interface. But then again, I've been out of the game for a little while. - Dan C.