9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: smiley@zenzebra.mv.com
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Q: moving directories? hard links?
Date: Sat, 16 Apr 2011 17:33:39 +0000	[thread overview]
Message-ID: <86d3km6qz0.fsf@cmarib.ramside> (raw)
In-Reply-To: <BANLkTinPPbGfsT8EVcZHxedYt+4O1pxmzA@mail.gmail.com> (ron minnich's message of "Fri, 15 Apr 2011 21:22:27 -0700")

ron minnich <rminnich@gmail.com> 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 <type,device,qid>.  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 <type,device> 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|
+---------------------------------------------------------------+



  parent reply	other threads:[~2011-04-16 17:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-16  2:36 smiley
2011-04-16  2:40 ` Jacob Todd
2011-04-16  4:22 ` ron minnich
2011-04-16 16:53   ` erik quanstrom
2011-04-16 17:33   ` smiley [this message]
2011-04-16 17:51     ` erik quanstrom
2011-04-21 15:32       ` smiley
2011-04-21 15:43         ` ron minnich
2011-04-16 18:22     ` Bakul Shah
2011-04-21 15:44       ` smiley
2011-04-21 15:49         ` ron minnich
2011-04-21 16:54         ` Bakul Shah
2011-04-21 20:17           ` Richard Miller
2011-04-21 21:10             ` Bakul Shah
2011-04-21 22:41               ` erik quanstrom
2011-04-21 23:17                 ` ron minnich
2011-04-21 23:54                   ` Bakul Shah
2011-04-21 23:55                   ` erik quanstrom
2011-04-22  0:01                     ` ron minnich
2011-04-22  0:04                       ` erik quanstrom
2011-04-22  8:03                 ` Bakul Shah
2011-04-22  8:27                   ` dexen deVries
2011-04-22 13:05                   ` erik quanstrom
2011-04-22 17:47                     ` Bakul Shah
2011-04-24 18:58                       ` erik quanstrom
2011-04-16 18:03   ` Richard Miller
2011-04-16 18:17     ` Skip Tavakkolian
2011-04-16 18:56       ` Rob Pike
2011-04-18  9:08         ` Aharon Robbins
2011-04-18 12:41           ` erik quanstrom
2011-04-18 12:59             ` Lucio De Re
2011-04-18 13:00               ` erik quanstrom
2011-04-18 13:11                 ` Lucio De Re
2011-04-23  3:48                   ` Ethan Grammatikidis
2011-04-21  9:22       ` Balwinder S Dheeman
2011-04-16 16:58 ` erik quanstrom
2011-04-19 15:36 ` Charles Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86d3km6qz0.fsf@cmarib.ramside \
    --to=smiley@zenzebra.mv.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).