From: Gabriel Diaz <gabidiaz@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu>
Subject: Re: [9fans] lib9p help
Date: Fri, 17 Feb 2006 22:50:07 +0100 [thread overview]
Message-ID: <82c890d00602171350m1835e791r6d44ec7a50b9e8e1@mail.gmail.com> (raw)
In-Reply-To: <bdb136fda99939c7939ec23bbf7d994b@swtch.com>
Hello,
i can see the Tcreate messages in ramfs, but not in my buggy test.
ramfs has it's own loop, may be it uses something like file/tree structures
but the ramfs.c i have here doesn't have a #include <9p.h>.
using chatty i see that ramfs has a Rwalk messagfe with a newquid and
then the Tcreate
message, while in the test with 9p.h i never got it, so it fails.
i have other tests with more fscalls implemented, but i should see
here the Rwalk message and the Tcreate message?
thanks
gabi
my test fs.c is like:
/*
* test1
*/
#include <u.h>
#include <libc.h>
#include <bio.h>
#include <auth.h>
#include <fcall.h>
#include <thread.h>
#include <9p.h>
Tree * tree;
File *ctlroot;
Srv fs;
static void
usage(void)
{
fprint(2, "usage: fs [-abcC] [-m mtpt]\n");
exits("usage");
}
void
main(int argc, char **argv)
{
ulong flag;
char *mtpt;
flag = 0;
mtpt = "/mnt/test";
ARGBEGIN{
case 'D':
chatty9p++;
break;
case 'a':
flag |= MAFTER;
break;
case 'b':
flag |= MBEFORE;
break;
case 'c':
flag |= MCREATE;
break;
case 'C':
flag |= MCACHE;
break;
case 'm':
mtpt = ARGF();
break;
default:
usage();
break;
}ARGEND;
if(argc != 0)
usage();
if ( flag == 0 )
flag = MAFTER;
tree = fs.tree = alloctree(getuser(), "sys", DMDIR|0775,nil);
ctlroot = createfile(fs.tree->root,"ctl",getuser(),0666,nil);
postmountsrv(&fs, nil, mtpt, flag);
exits(0);
}
On 2/17/06, Russ Cox <rsc@swtch.com> wrote:
> > always fails when using lib9p. i though i need to provide walk1 and
> > clone to create
> > directories that doesn't exists. Using the chatty option all messages are walks
> > when doing mkdirs abd when touching a file.
>
> i don't believe that. there should be Tcreate messages too.
>
> /sys/src/lib9p/ramfs.c uses file/tree structures
> (and allows creation of new files). 9p(2) says
>
> Create
> The create function must fill in both r->fid->qid and
> r->ofcall.qid on success. When using file trees,
> create should allocate a new File with createfile; note
> that createfile may return nil (because, say, the file
> already exists). If the create function is nil, srv
> behaves as though it were a function that always
> responded with the error ``create prohibited''.
>
> russ
>
>
next prev parent reply other threads:[~2006-02-17 21:50 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-02-17 12:15 Gabriel Diaz
2006-02-17 13:10 ` Russ Cox
2006-02-17 21:23 ` Gabriel Diaz
2006-02-17 16:30 ` Russ Cox
2006-02-17 21:50 ` Gabriel Diaz [this message]
2006-02-17 17:14 ` Russ Cox
2006-02-17 22:22 ` Gabriel Diaz
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=82c890d00602171350m1835e791r6d44ec7a50b9e8e1@mail.gmail.com \
--to=gabidiaz@gmail.com \
--cc=9fans@cse.psu.edu \
/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).