9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] mounting channels in a Plan 9 server?
@ 2004-03-27 17:38 andrey mirtchovski
  2004-03-29 20:23 ` rog
  0 siblings, 1 reply; 2+ messages in thread
From: andrey mirtchovski @ 2004-03-27 17:38 UTC (permalink / raw)
  To: 9fans

what's the best way to import a file hierarchy into a 9p server?  for
example, when i'm serving a set of files (A) and want to add to that
set another hierarchy served by a different program (B) on a file
descriptor i have.

trivially it could be done using general plan9 tools by mounting A
somewhere, mounting B in one of the directories served by A and
srvfs-ing the whole thing, but what if I don't want to post a file
descriptor in /srv?  looking at the devsrv code in /sys/src/9/port
doesn't have a solution, since all the 9p messages there return
channels, which doesn't happen in userland...  i also looked at the
QTMOUNT mode bit but there are exactly three examples or it being
used, none of which tell whether it's the thing i need.

so my question is: is there a possibility to say 'here is a file
descriptor/chan you shall use for your next request' when a client
walks a file hierarchy i'm serving?  i.e.  is there a way to mount a
file descriptor in an in-memory server?

andrey



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

* Re: [9fans] mounting channels in a Plan 9 server?
  2004-03-27 17:38 [9fans] mounting channels in a Plan 9 server? andrey mirtchovski
@ 2004-03-29 20:23 ` rog
  0 siblings, 0 replies; 2+ messages in thread
From: rog @ 2004-03-29 20:23 UTC (permalink / raw)
  To: 9fans

> trivially it could be done using general plan9 tools by mounting A
> somewhere, mounting B in one of the directories served by A and
> srvfs-ing the whole thing, but what if I don't want to post a file
> descriptor in /srv?

then use exportfs directly (it's what srvfs uses, after all).

this is the correct solution; in general you can't just add the
namespace for one 9p server into another - after all they use
different qid, tag and fid spaces.

this kind of multiplexing is exactly what exportfs is for.  (along
with the kernel itself).

you could of course do the job of exportfs within your own fileserver
(but there are lots of non-trivial gotchas).  in limited domains, this
can be a reasonable approach; i've done similar things in the past.



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

end of thread, other threads:[~2004-03-29 20:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-27 17:38 [9fans] mounting channels in a Plan 9 server? andrey mirtchovski
2004-03-29 20:23 ` rog

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