From: Miklos Szeredi Date: Wed, 14 Jul 2004 16:16:59 +0000 (+0000) Subject: patch by Luca Ferroni X-Git-Tag: fuse_1_9~29 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=62bc875d732f7b9ada2661598e1dcad9d24ebf2f;p=qemu-gpiodev%2Flibfuse.git patch by Luca Ferroni --- diff --git a/lufis/lufis.c b/lufis/lufis.c index a8b17c9..5509bdf 100644 --- a/lufis/lufis.c +++ b/lufis/lufis.c @@ -12,6 +12,7 @@ #include #include #include +#include /* statfs extension for captivefs */ struct lufs_sbattr_ { /* struct statfs64 */ @@ -551,13 +552,6 @@ static int lu_release(const char *path, int flags) return 0; } -static int lu_default_statfs(struct statfs *buf) -{ - buf->f_namelen = 255; - buf->f_bsize = 512; - return 0; -} - #if FUSE_MAJOR_VERSION < 2 static int lu_statfs(struct fuse_statfs *stbuf) #else @@ -566,12 +560,11 @@ static int lu_statfs(const char *path, struct statfs *stbuf) { struct lufs_sbattr_ sbattr; - if(!lu_fops.statfs) - return lu_default_statfs(stbuf); - memset(&sbattr, 0, sizeof(sbattr)); - if(lu_fops.statfs(lu_context, &sbattr) < 0) - return -EPERM; + if(lu_fops.statfs) { + if(lu_fops.statfs(lu_context, &sbattr) < 0) + return -EPERM; + } #if FUSE_MAJOR_VERSION < 2 stbuf->blocks = sbattr.sb_bytes / 512; @@ -725,6 +718,8 @@ static int lufis_init(int *argcp, char **argvp[]) return -1; } + lu_opt_loadcfg(&lu_cfg, "/etc/lufsd.conf"); + (*argcp)--; (*argvp)++; argv[1] = argv[0];