9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] clone files and Srv->clone
@ 2005-12-10 17:43 Sascha Retzki
  2005-12-10 18:14 ` Francisco J Ballesteros
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Retzki @ 2005-12-10 17:43 UTC (permalink / raw)
  To: 9fans

Evenin',


I've got a question about the process of cloning in the 9p(2) sense and
in the sense of e.g. webfs does: Is it the same?

Or, to explain my problem from the top-down perspective, I want my lil
file-server to have a clone-file. On read, a new directory with a tree
is created and the name of this new directory is returned. Is it that I
have to do that mostly manually, or can Srv->walk1 and Srv->clone help
me? If yes, how (rougly)? Or am I mistaken, and there is some all-in-one
solution to my problem (because many file-server do it in this way, I
assume there is some library-calls for that?)


Thanks, Sascha


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] clone files and Srv->clone
  2005-12-10 17:43 [9fans] clone files and Srv->clone Sascha Retzki
@ 2005-12-10 18:14 ` Francisco J Ballesteros
  2005-12-10 20:40   ` Russ Cox
  0 siblings, 1 reply; 4+ messages in thread
From: Francisco J Ballesteros @ 2005-12-10 18:14 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

srv->clone clones a client fid. You can think of it like
doing a dup of a file descriptor. You obtain a new fid that is a clone
of the old one. Try man 5 clone.

Walk1 walks a name. For example, you might have a fid for your
/ file. After a walk1 "a" on that fid, your fid now points to "/a". See
man 5 walk.

You might do a clone file but that has nothing to do with walk and clone.
For example, you might arrange for your srv->open to create a new file
each time, and then make the fid point to it. That way, each open(2)
would obtain a cloned file.

Run for example ramfs with -D, play with touch ls and the like, and look
at the 9p messages printed by ramfs. Section 5 describes the whole
protocol.

hth

On 12/10/05, Sascha Retzki <sretzki@gmx.de> wrote:
> Evenin',
>
>
> I've got a question about the process of cloning in the 9p(2) sense and
> in the sense of e.g. webfs does: Is it the same?
>
> Or, to explain my problem from the top-down perspective, I want my lil
> file-server to have a clone-file. On read, a new directory with a tree
> is created and the name of this new directory is returned. Is it that I
> have to do that mostly manually, or can Srv->walk1 and Srv->clone help
> me? If yes, how (rougly)? Or am I mistaken, and there is some all-in-one
> solution to my problem (because many file-server do it in this way, I
> assume there is some library-calls for that?)
>
>
> Thanks, Sascha
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] clone files and Srv->clone
  2005-12-10 18:14 ` Francisco J Ballesteros
@ 2005-12-10 20:40   ` Russ Cox
  2005-12-10 21:38     ` Francisco J Ballesteros
  0 siblings, 1 reply; 4+ messages in thread
From: Russ Cox @ 2005-12-10 20:40 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

As Nemo points out, Srv.clone and
clone files like in the network stack
are completely different things.

In the original 9P protocol, there was
a Tclone message that was identical in
functionality to a 9P2000 Twalk with
nname==0.  That's where the name
comes from.

Russ


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9fans] clone files and Srv->clone
  2005-12-10 20:40   ` Russ Cox
@ 2005-12-10 21:38     ` Francisco J Ballesteros
  0 siblings, 0 replies; 4+ messages in thread
From: Francisco J Ballesteros @ 2005-12-10 21:38 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

Sorry, that´s true. clone(5) is gone. Walk does both things now.

On 12/10/05, Russ Cox <rsc@swtch.com> wrote:
> As Nemo points out, Srv.clone and
> clone files like in the network stack
> are completely different things.
>
> In the original 9P protocol, there was
> a Tclone message that was identical in
> functionality to a 9P2000 Twalk with
> nname==0.  That's where the name
> comes from.
>
> Russ
>
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-12-10 21:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-10 17:43 [9fans] clone files and Srv->clone Sascha Retzki
2005-12-10 18:14 ` Francisco J Ballesteros
2005-12-10 20:40   ` Russ Cox
2005-12-10 21:38     ` Francisco J Ballesteros

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).