9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "roger peppe" <rogpeppe@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@9fans.net>
Subject: Re: [9fans] fd2path and devsrv
Date: Thu, 20 Nov 2008 09:44:59 +0000	[thread overview]
Message-ID: <df49a7370811200144v46e2e2e5n7ba02d84105f357c@mail.gmail.com> (raw)
In-Reply-To: <8ccc8ba40811191136g54cde269g98ffafdcac3f1451@mail.gmail.com>

On Wed, Nov 19, 2008 at 7:36 PM, Francisco J Ballesteros <nemo@lsub.org> wrote:
> BTW, I´d love to hear other experiences regarding ns or path reconstruction.

i wrote a reverse path evaluator (ftrans) for inferno - given a path,
it uses fd2path and /prog/xx/ns to attempt to return the
originally mounted path.

the reason for implementing it was to make it easier to generate
paths to be used externally, in particular for the os(1) command.
it gives a certain amount of freedom to re-bind paths locally
to make convenient aliases without needing to modify all the
software to take account of the new convention.

obviously there are many cases where it's not possible
(e.g. where two directories from the same filesystem
are union-bound together), but it does work ok.

in cases where the bind is ambiguous, it stats ancestors of the file
and disambiguates by looking at the device letter (it'd be
useful if ns provided the dev number of the mounted file,
as well as the device letter).

it punts on actual mounts - there's nothing useful you can do
programmatically with a mount ns entry, you can't re-mount it, and
ns doesn't record how the original Chan was generated (that's
not true in plan 9, where you can remount the #s entry, of course).

instead, it takes an association list of "stop paths" - paths where it
stops the search and returns the associated answer.

this means that where a particular path is ambiguous, or unresolvable
(e.g. mount kremvax /n/krem), we can associate that path with
the desired outcome, if there is one.

  parent reply	other threads:[~2008-11-20  9:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-19 17:45 Roman V. Shaposhnik
2008-11-19 19:36 ` Francisco J Ballesteros
2008-11-20  1:37   ` Roman V. Shaposhnik
2008-11-20  1:41     ` erik quanstrom
2008-11-20  2:56       ` Roman V. Shaposhnik
2008-11-20  2:55         ` erik quanstrom
2008-11-20  3:31           ` Roman Shaposhnik
2008-11-20  3:32             ` erik quanstrom
2008-11-20  3:57               ` Roman Shaposhnik
2008-11-20  4:14                 ` erik quanstrom
2008-11-20  5:05                   ` Roman Shaposhnik
2008-11-20  9:44   ` roger peppe [this message]
2008-11-20 12:59     ` Steve Simon
2008-11-20 13:50       ` roger peppe

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=df49a7370811200144v46e2e2e5n7ba02d84105f357c@mail.gmail.com \
    --to=rogpeppe@gmail.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).