diff options
Diffstat (limited to 'example')
-rw-r--r-- | example/fusexmp.c | 20 | ||||
-rw-r--r-- | example/null.c | 7 |
2 files changed, 8 insertions, 19 deletions
diff --git a/example/fusexmp.c b/example/fusexmp.c index 1a96ba5..3c1b601 100644 --- a/example/fusexmp.c +++ b/example/fusexmp.c @@ -233,19 +233,15 @@ static int xmp_write(const char *path, const char *buf, size_t size, return res; } -static int xmp_statfs(struct fuse_statfs *fst) +static int xmp_statfs(const char *path, struct statfs *stbuf) { - struct statfs st; - int rv = statfs("/",&st); - if(!rv) { - fst->block_size = st.f_bsize; - fst->blocks = st.f_blocks; - fst->blocks_free = st.f_bavail; - fst->files = st.f_files; - fst->files_free = st.f_ffree; - fst->namelen = st.f_namelen; - } - return rv; + int res; + + res = statfs(path, stbuf); + if(res == -1) + return -errno; + + return 0; } static int xmp_release(const char *path, int flags) diff --git a/example/null.c b/example/null.c index f9ead78..d897e92 100644 --- a/example/null.c +++ b/example/null.c @@ -64,19 +64,12 @@ static int null_write(const char *path, const char *UNUSED(buf), size_t size, return size; } -static int null_statfs(struct fuse_statfs *st) -{ - return st->block_size = st->blocks = st->blocks_free = st->files = - st->files_free = st->namelen = 0; -} - static struct fuse_operations null_oper = { .getattr = null_getattr, .truncate = null_truncate, .open = null_open, .read = null_read, .write = null_write, - .statfs = null_statfs, }; int main(int argc, char *argv[]) |