bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rm patch suggestion


From: Niels Möller
Subject: Re: rm patch suggestion
Date: 09 May 2002 01:52:22 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

tb@becket.net (Thomas Bushnell, BSG) writes:

> I don't know.  I think on reflection that lookups of "." should start
> translators the normal way.  (How else do you want to get them started
> if you want that?)

One could argue that the normal case is that the translator is started
when you cd into the directory, or look it up from its parent in some
other way. And if for some reason (like O_NOTRANS) that didn't happen,
that was probably intentional.

Say you have the translated node and its underlying node. How does one
get from one to the other?

One can get from translated to underlying node by looking up "." with
O_NOTRANS. (Actually, I'm not quite sure that this is either true or
desirable, it might make sense that "." returns the same node also in
this case, no matter what flags you give it. But below, I'm assuming
that it is indeed true).

I think you're asking how to get the other way, and you're suggesting
that plain lookup of "." should do that. I feel that the True Meaning
of the "." link should be to point back to itself, and not point along
the "translated-as" dimension.

Thus, if the inverse of lookup(".", O_NOTRANS) is needed, I don't
think plain lookup(".") is the right name for it.

Perhaps things like lookup(".", O_TRANS), or "cd -f ." would be
better, but I'm not convinced that navigation directly from underlying
to translated node or back is needed in the first place. In general,
when translators enter the scene, lookup operations don't in general
have inverses or backlinks, so it's not the first missing inverse link
in the filesystem. The archetypical example is "foo/.." == ".", where
".." works as the backlink, and it doesn't work if "foo" happens to be
a symlink.

I think it's reasonable to expect that "foo/.." == "./foo/.." == "."
if only the lookup of the "foo"-component is performed with O_NOTRANS.

Or more formally, if p is a directory port, and foo the name of a
subdirectory, then

  p == dir_lookup_under(p, ".", 0)

  /* if foo not translated */
  p == dir_lookup_under(dir_lookup_under(p, "foo", 0), "..", 0)

  /* for any foo */
  p == dir_lookup_under(dir_lookup_under(p, "foo", O_NOTRANS), "..", 0)

/Niels



reply via email to

[Prev in Thread] Current Thread [Next in Thread]