From mboxrd@z Thu Jan 1 00:00:00 1970 From: smiley@zenzebra.mv.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <8662qej52i.fsf@cmarib.ramside> Date: Sat, 16 Apr 2011 17:33:39 +0000 In-Reply-To: (ron minnich's message of "Fri, 15 Apr 2011 21:22:27 -0700") Message-ID: <86d3km6qz0.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [9fans] Q: moving directories? hard links? Topicbox-Message-UUID: d07098b0-ead6-11e9-9d60-3106f5b1d025 ron minnich writes: > If you look at what a hard link is, you'll realize why they are not in > Plan 9. It's not that obvious to me. A hard link is another name for a file, uniquely identified by . The effect of a hard link can be simulated with bind, but requires managing a list of excetions (one bind for each "link"). If the binding were done server-side, there would need to be some additional protocol element (perhaps a Tbind request) to add another name to a file. The semantics of Tbind could meaningfully be extended to all types of files, not just disk files. I don't understand why 9P doesn't allow transporting bind operations from machine to machine like this. /sys/doc/9.ps talks about ongoing research on ways to export namespaces from one machine to another. Allowing binds to traverse 9P seems to be an easy way to do that. The alternative, making a full copy of the file/directory, wastes disk space (unless it's de-duplicated by Venti) and bandwidth. It's similar for moving directories. If you have a 10 GiB directory, doing dircp&&rm requires 20 GiB to traverse the link to the file server. At $local_big_networking_corp, I got chewed out for copying a 650MB ISO across a single router. If the 9P Twstat message had a destdirfid field, a fid could be relocated by altering file system metadata alone. If the destdirfid does not represent a directory, or represents a location on a different file system, then just return Rerror("move crosses bind") and make the client do a full dircp&&rm. I suppose it's possible to interpose a file system, call it "linkfs", between the file server and user processes. Something like: term% linkfs -f /path/to/persistent/bind/cache term% mount /srv/linkfs / term% echo foo > /some/path term% echo /some/path /another/path > /dev/hardlink term% cat /another/path foo AFAIK, "linkfs" doesn't exist. I totally made it up; I'm just throwing out some ideas, here. -- +---------------------------------------------------------------+ |E-Mail: smiley@zenzebra.mv.com PGP key ID: BC549F8B| |Fingerprint: 9329 DB4A 30F5 6EDA D2BA 3489 DAB7 555A BC54 9F8B| +---------------------------------------------------------------+