9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] implmenting /mnt/9/clone
@ 2005-07-29 19:19 Ronald G. Minnich
  2005-07-29 19:24 ` Eric Van Hensbergen
  2005-07-29 19:39 ` Russ Cox
  0 siblings, 2 replies; 7+ messages in thread
From: Ronald G. Minnich @ 2005-07-29 19:19 UTC (permalink / raw)
  To: 9fans


I'm playing around with the p9p ramfs server, and was wondering about the 
best way to implement a file for clone. 

e.g. I have /mnt/9/clone, and when clone is opened, I want to to mean that
/mnt/9/1/ctl is created and fid for that file returned to client, and the
next open of clone gets /mnt/9/2/ctl, etc. As usual, a read of the ctl 
would return the # for that ctl file. 

I can think of a couple of ways to 
do it, with the simplest involving:
- when clone is opened, create #/ctl, e.g. 3/ctl
- swap the qids for clone and the #/ctl file

Any comments on this, or hidden gotchas, or ...

I'm pretty sure this would work for Linux 9p clients, but am not sure 
about the overal cleanliness of this approach, or if there is some better 
way to do it.

ron


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 19:19 [9fans] implmenting /mnt/9/clone Ronald G. Minnich
@ 2005-07-29 19:24 ` Eric Van Hensbergen
  2005-07-29 19:47   ` Ronald G. Minnich
  2005-07-29 19:39 ` Russ Cox
  1 sibling, 1 reply; 7+ messages in thread
From: Eric Van Hensbergen @ 2005-07-29 19:24 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

On 7/29/05, Ronald G. Minnich <rminnich@lanl.gov> wrote:
> 
> I'm playing around with the p9p ramfs server, and was wondering about the
> best way to implement a file for clone.
> 
> e.g. I have /mnt/9/clone, and when clone is opened, I want to to mean that
> /mnt/9/1/ctl is created and fid for that file returned to client, and the
> next open of clone gets /mnt/9/2/ctl, etc. As usual, a read of the ctl
> would return the # for that ctl file.
> 

One small problem I've noticed with v9fs and clone style file systems
(in particular ACME) -- make sure things like stat don't trigger the
creation of the resource, otherwise things like ls -l will end up
creating windows, etc.  I haven't found a good way around this from a
Linux perspective.

          -eric


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 19:19 [9fans] implmenting /mnt/9/clone Ronald G. Minnich
  2005-07-29 19:24 ` Eric Van Hensbergen
@ 2005-07-29 19:39 ` Russ Cox
  2005-07-29 23:13   ` Ronald G. Minnich
  1 sibling, 1 reply; 7+ messages in thread
From: Russ Cox @ 2005-07-29 19:39 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

> I'm playing around with the p9p ramfs server, and was wondering about the
> best way to implement a file for clone.

If you want to build a regular (patterned) synthetic file system,
don't start with the ramfs server, which has a lot of extra baggage
because it must support a general file tree instead of a
regular synthetic one.  In particular, regular file systems
can use regular qids and assign meaning to them.
Cdfs and sshnet are good examples of this on Plan 9.  Look at those.

Russ


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 19:24 ` Eric Van Hensbergen
@ 2005-07-29 19:47   ` Ronald G. Minnich
  2005-07-29 20:54     ` Eric Van Hensbergen
  0 siblings, 1 reply; 7+ messages in thread
From: Ronald G. Minnich @ 2005-07-29 19:47 UTC (permalink / raw)
  To: Eric Van Hensbergen, Fans of the OS Plan 9 from Bell Labs



On Fri, 29 Jul 2005, Eric Van Hensbergen wrote:

> One small problem I've noticed with v9fs and clone style file systems
> (in particular ACME) -- make sure things like stat don't trigger the
> creation of the resource, otherwise things like ls -l will end up
> creating windows, etc.  I haven't found a good way around this from a
> Linux perspective.

interesting. This is due to "negative dentries" I guess? 

ron


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 19:47   ` Ronald G. Minnich
@ 2005-07-29 20:54     ` Eric Van Hensbergen
  2005-07-29 20:58       ` Russ Cox
  0 siblings, 1 reply; 7+ messages in thread
From: Eric Van Hensbergen @ 2005-07-29 20:54 UTC (permalink / raw)
  To: Ronald G. Minnich; +Cc: Fans of the OS Plan 9 from Bell Labs

On 7/29/05, Ronald G. Minnich <rminnich@lanl.gov> wrote:
> 
> 
> On Fri, 29 Jul 2005, Eric Van Hensbergen wrote:
> 
> > One small problem I've noticed with v9fs and clone style file systems
> > (in particular ACME) -- make sure things like stat don't trigger the
> > creation of the resource, otherwise things like ls -l will end up
> > creating windows, etc.  I haven't found a good way around this from a
> > Linux perspective.
> 
> interesting. This is due to "negative dentries" I guess?
> 

Well, it goes beyond that - Linux is sending getattr for every file
(because it doesn't know it call all the data it needs from the
readdir) so its walking and stating every file.  The only way to get
around this is a temporal cache on the metadata (both dentry and
inode) -- but this could cause problems in other situations (how long
before you invalidate the inode or dentry data?).

I haven't looked into exactly what sets ACME off, but I figure it's
probably keying off the walk.

         -eric


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 20:54     ` Eric Van Hensbergen
@ 2005-07-29 20:58       ` Russ Cox
  0 siblings, 0 replies; 7+ messages in thread
From: Russ Cox @ 2005-07-29 20:58 UTC (permalink / raw)
  To: Eric Van Hensbergen, Fans of the OS Plan 9 from Bell Labs

ls -l /mnt/acme/new on Plan 9 does the same thing.
It's not worth worrying about as far as v9fs is concerned.

Russ


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

* Re: [9fans] implmenting /mnt/9/clone
  2005-07-29 19:39 ` Russ Cox
@ 2005-07-29 23:13   ` Ronald G. Minnich
  0 siblings, 0 replies; 7+ messages in thread
From: Ronald G. Minnich @ 2005-07-29 23:13 UTC (permalink / raw)
  To: Russ Cox, Fans of the OS Plan 9 from Bell Labs



On Fri, 29 Jul 2005, Russ Cox wrote:

> Cdfs and sshnet are good examples of this on Plan 9.  Look at those.

thanks. sshnet is *exactly* what I need. It's also (yet another) very 
useful learning tool. 

ron


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

end of thread, other threads:[~2005-07-29 23:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-29 19:19 [9fans] implmenting /mnt/9/clone Ronald G. Minnich
2005-07-29 19:24 ` Eric Van Hensbergen
2005-07-29 19:47   ` Ronald G. Minnich
2005-07-29 20:54     ` Eric Van Hensbergen
2005-07-29 20:58       ` Russ Cox
2005-07-29 19:39 ` Russ Cox
2005-07-29 23:13   ` Ronald G. Minnich

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