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 <[EMAIL PROTECTED]> 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
>
>

Reply via email to