diff options
author | 2004-02-19 14:23:27 +0000 | |
---|---|---|
committer | 2004-02-19 14:23:27 +0000 | |
commit | 18e75e4cb186b5d247caea5c9aa21b69e4914c50 (patch) | |
tree | 71fdaa602c8c70ecf933a9ec4cd3e4d8156026e8 /lib | |
parent | fa39e90ea08e2d6f976deec8f12eda27a14e0813 (diff) |
statfs fixes
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fuse.c | 19 |
1 files changed, 17 insertions, 2 deletions
@@ -853,15 +853,30 @@ static void do_write(struct fuse *f, struct fuse_in_header *in, send_reply(f, in, res, NULL, 0); } +static void convert_statfs(struct statfs *statfs, struct fuse_kstatfs *kstatfs) +{ + kstatfs->bsize = statfs->f_bsize; + kstatfs->blocks = statfs->f_blocks; + kstatfs->bfree = statfs->f_bfree; + kstatfs->bavail = statfs->f_bavail; + kstatfs->files = statfs->f_files; + kstatfs->ffree = statfs->f_ffree; + kstatfs->namelen = statfs->f_namelen; +} + static void do_statfs(struct fuse *f, struct fuse_in_header *in) { int res; struct fuse_statfs_out arg; + struct statfs buf; res = -ENOSYS; if(f->op.statfs) { - memset(&arg, 0, sizeof(struct fuse_statfs_out)); - res = f->op.statfs((struct fuse_statfs *) &arg.st); + res = f->op.statfs("/", &buf); + if(res == 0) { + memset(&arg, 0, sizeof(struct fuse_statfs_out)); + convert_statfs(&buf, &arg.st); + } } send_reply(f, in, res, &arg, sizeof(arg)); |