--- perl/trunk/Fuse.xs 2005/12/21 15:33:37 18 +++ perl-llin/Fuse.xs 2006/01/02 22:39:32 28 @@ -30,7 +30,7 @@ #include #undef DEBUGf -#if 0 +#if 1 #define DEBUGf(f, a...) fprintf(stderr, "%s:%d (%i): " f,__BASE_FILE__,__LINE__,sp-PL_stack_base ,##a ) #else #define DEBUGf(a...) @@ -501,7 +501,7 @@ rv = 0; } if(rv > buflen) - croak("%i: read() handler returned more than buflen! (%i > %i)",getpid(),rv,buflen); + croak("read() handler returned more than buflen! (%i > %i)",rv,buflen); if(rv) memcpy(buf,SvPV_nolen(mysv),rv); } @@ -541,7 +541,8 @@ return rv; } -int _PLfuse_statfs (const char *file, struct statfs *st) { +/* FIXME check for old fuse API (< 21?) and use statfs here */ +int _PLfuse_statfs (const char *file, struct statvfs *st) { int rv; char *rvstr; FUSE_CONTEXT_PRE; @@ -553,14 +554,20 @@ PUTBACK; rv = call_sv(_PLfuse_callbacks[17],G_ARRAY); SPAGAIN; - if(rv > 5) { + DEBUGf("statfs got %i params\n",rv); + if(rv == 6 || rv == 7) { st->f_bsize = POPi; - st->f_bfree = POPi; + st->f_bfree = st->f_bavail = POPi; st->f_blocks = POPi; - st->f_ffree = POPi; + st->f_ffree = st->f_favail = POPi; st->f_files = POPi; - st->f_namelen = POPi; - if(rv > 6) + st->f_namemax = POPi; + /* zero all other */ + st->f_frsize = 4096; + st->f_fsid = 0; + st->f_flag = 0; + + if(rv == 7) rv = POPi; else rv = 0; @@ -857,7 +864,9 @@ void perl_fuse_main(...) PREINIT: - struct fuse_operations fops = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; + struct fuse_operations fops = + {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL, + NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}; int i, fd, varnum = 0, debug, threaded, have_mnt; char *mountpoint; char *mountopts; @@ -885,14 +894,21 @@ mountopts = SvPV_nolen(ST(3)); for(i=0;i