From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <95ca4651d6ef63b8d5f5cbdc9b8749b7@collyer.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] FS question From: Geoff Collyer In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Mon, 10 Nov 2003 16:01:41 -0800 Topicbox-Message-UUID: 85c6da18-eacc-11e9-9e20-41e7f4b1d025 I didn't use the original Unix file system, but the V6-era (ca. 1975) one was simple yet provided substantial utility. The main uses of links that I can recall were locking and renaming. Linking to an agreed-upon name was atomic and formed the basis for most locking by cooperating processes before things like lockf and flock (and eventually the 'l' bit). Renaming was done by linking from the old name to the new, then removing the old name (if the link succeeded). This even worked for directories (adding some fiddling with .. entries) and let one move files and directories anywhere within a given file system's directory tree. The modern (Berkeley) rename() primitive is by contrast very difficult to get right, taking into account races and potential errors of various sorts. The one thing that links permitted and that I miss in Plan 9 is being able to efficiently move directories arbitrarily within a file system, though it's less of an issue than on Unix, where shuffling directory hierarchies was the vendors' and standards bodies' equivalent of corporate reorganisation (i.e., we'll rename everything and hope that nobody notices that we haven't done much else).