X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=Fuse.xs;h=1efe6dbe15b03d72f6495bb44d2dd5e99029d8f0;hb=401b97cda89fa51baa974712ccf6a44d545770f8;hp=57f0b603eb5b28140076be1c63804e66a189be7c;hpb=4544cbe3708a5e8552232745ca1b03d4a568f339;p=perl-fuse.git diff --git a/Fuse.xs b/Fuse.xs index 57f0b60..1efe6db 100644 --- a/Fuse.xs +++ b/Fuse.xs @@ -501,7 +501,7 @@ int _PLfuse_read (const char *file, char *buf, size_t buflen, off_t off) { 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 @@ int _PLfuse_write (const char *file, const char *buf, size_t buflen, off_t off) 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; @@ -555,11 +556,16 @@ int _PLfuse_statfs (const char *file, struct statfs *st) { SPAGAIN; if(rv > 5) { 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; + st->f_namemax = POPi; + /* zero all other */ + st->f_frsize = 4096; + st->f_fsid = 0; + st->f_flag = 0; + if(rv > 6) rv = POPi; else @@ -857,7 +863,9 @@ PROTOTYPES: DISABLE 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 +893,21 @@ perl_fuse_main(...) mountopts = SvPV_nolen(ST(3)); for(i=0;i