30 |
#include <fuse/fuse.h> |
#include <fuse/fuse.h> |
31 |
|
|
32 |
#undef DEBUGf |
#undef DEBUGf |
33 |
#if 0 |
#if 1 |
34 |
#define DEBUGf(f, a...) fprintf(stderr, "%s:%d (%i): " f,__BASE_FILE__,__LINE__,sp-PL_stack_base ,##a ) |
#define DEBUGf(f, a...) fprintf(stderr, "%s:%d (%i): " f,__BASE_FILE__,__LINE__,sp-PL_stack_base ,##a ) |
35 |
#else |
#else |
36 |
#define DEBUGf(a...) |
#define DEBUGf(a...) |
541 |
return rv; |
return rv; |
542 |
} |
} |
543 |
|
|
544 |
int _PLfuse_statfs (const char *file, struct statfs *st) { |
/* FIXME check for old fuse API (< 21?) and use statfs here */ |
545 |
|
int _PLfuse_statfs (const char *file, struct statvfs *st) { |
546 |
int rv; |
int rv; |
547 |
char *rvstr; |
char *rvstr; |
548 |
FUSE_CONTEXT_PRE; |
FUSE_CONTEXT_PRE; |
554 |
PUTBACK; |
PUTBACK; |
555 |
rv = call_sv(_PLfuse_callbacks[17],G_ARRAY); |
rv = call_sv(_PLfuse_callbacks[17],G_ARRAY); |
556 |
SPAGAIN; |
SPAGAIN; |
557 |
if(rv > 5) { |
DEBUGf("statfs got %i params\n",rv); |
558 |
|
if(rv == 6 || rv == 7) { |
559 |
st->f_bsize = POPi; |
st->f_bsize = POPi; |
560 |
st->f_bfree = POPi; |
st->f_bfree = st->f_bavail = POPi; |
561 |
st->f_blocks = POPi; |
st->f_blocks = POPi; |
562 |
st->f_ffree = POPi; |
st->f_ffree = st->f_favail = POPi; |
563 |
st->f_files = POPi; |
st->f_files = POPi; |
564 |
st->f_namelen = POPi; |
st->f_namemax = POPi; |
565 |
if(rv > 6) |
/* zero all other */ |
566 |
|
st->f_frsize = 4096; |
567 |
|
st->f_fsid = 0; |
568 |
|
st->f_flag = 0; |
569 |
|
|
570 |
|
if(rv == 7) |
571 |
rv = POPi; |
rv = POPi; |
572 |
else |
else |
573 |
rv = 0; |
rv = 0; |