193 files changed, 80411 insertions, 44563 deletions
diff --git a/libfuse-lite/fuse_lowlevel.c b/libfuse-lite/fuse_lowlevel.c index 1457e6c..2ade0d3 100755 --- a/libfuse-lite/fuse_lowlevel.c +++ b/libfuse-lite/fuse_lowlevel.c @@ -192,6 +192,7 @@ static int send_reply(fuse_req_t req, int error, const void *arg, return send_reply_iov(req, error, iov, count); } +#if 0 /* not used */ int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count) { int res; @@ -209,6 +210,7 @@ int fuse_reply_iov(fuse_req_t req, const struct iovec *iov, int count) return res; } +#endif size_t fuse_dirent_size(size_t namelen) { @@ -248,8 +250,7 @@ size_t fuse_add_direntry(fuse_req_t req, char *buf, size_t bufsize, } #if HAVE_SYS_STATVFS_H - -static void convert_statfs(const struct statfs *stbuf, +static void convert_statfs(const struct statvfs *stbuf, struct fuse_kstatfs *kstatfs) { kstatfs->bsize = stbuf->f_bsize; @@ -259,11 +260,10 @@ static void convert_statfs(const struct statfs *stbuf, kstatfs->bavail = stbuf->f_bavail; kstatfs->files = stbuf->f_files; kstatfs->ffree = stbuf->f_ffree; - kstatfs->namelen = stbuf->f_namelen; + kstatfs->namelen = stbuf->f_namemax; } #endif - static int send_reply_ok(fuse_req_t req, const void *arg, size_t argsize) { return send_reply(req, 0, arg, argsize); @@ -417,8 +417,7 @@ int fuse_reply_buf(fuse_req_t req, const char *buf, size_t size) } #if HAVE_SYS_STATVFS_H - -int fuse_reply_statfs(fuse_req_t req, const struct statfs *stbuf) +int fuse_reply_statfs(fuse_req_t req, const struct statvfs *stbuf) { struct fuse_statfs_out arg; size_t size = req->f->conn.proto_minor < 4 ? FUSE_COMPAT_STATFS_SIZE : sizeof(arg); @@ -430,7 +429,6 @@ int fuse_reply_statfs(fuse_req_t req, const struct statfs *stbuf) } #endif - int fuse_reply_xattr(fuse_req_t req, size_t count) { struct fuse_getxattr_out arg; @@ -552,7 +550,7 @@ static void do_mknod(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) name = (const char *) inarg + FUSE_COMPAT_MKNOD_IN_SIZE; if (req->f->op.mknod) - req->f->op.mknod(req, nodeid, name, arg->mode, arg->rdev); + req->f->op.mknod(req, nodeid, name, arg->mode, arg->rdev); else fuse_reply_err(req, ENOSYS); } @@ -627,7 +625,7 @@ static void do_link(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) static void do_create(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) { - const struct fuse_create_in *arg = (const struct fuse_create_in *) inarg; + const struct fuse_create_in *arg = (const struct fuse_create_in *) inarg; if (req->f->op.create) { struct fuse_file_info fi; @@ -816,6 +814,7 @@ static void do_fsyncdir(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) fuse_reply_err(req, ENOSYS); } +#if HAVE_SYS_STATVFS_H static void do_statfs(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) { (void) nodeid; @@ -824,15 +823,14 @@ static void do_statfs(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) if (req->f->op.statfs) req->f->op.statfs(req, nodeid); else { -#if HAVE_SYS_STATVFS_H - struct statfs buf = { - .f_namelen = 255, + struct statvfs buf = { + .f_namemax = 255, .f_bsize = 512, }; fuse_reply_statfs(req, &buf); -#endif } } +#endif static void do_setxattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) { @@ -1053,6 +1051,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) if (arg->flags & FUSE_DONT_MASK) f->conn.capable |= FUSE_CAP_DONT_MASK; #endif + if (arg->flags & FUSE_BIG_WRITES) + f->conn.capable |= FUSE_CAP_BIG_WRITES; } else { f->conn.async_read = 0; f->conn.max_readahead = 0; @@ -1097,7 +1097,8 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) if (f->conn.want & FUSE_CAP_DONT_MASK) outarg.flags |= FUSE_DONT_MASK; #endif - outarg.flags |= FUSE_BIG_WRITES ; + if (f->conn.want & FUSE_CAP_BIG_WRITES) + outarg.flags |= FUSE_BIG_WRITES; outarg.max_readahead = f->conn.max_readahead; outarg.max_write = f->conn.max_write; @@ -1135,18 +1136,6 @@ const struct fuse_ctx *fuse_req_ctx(fuse_req_t req) return &req->ctx; } -/* - * The size of fuse_ctx got extended, so need to be careful about - * incompatibility (i.e. a new binary cannot work with an old - * library). - */ -const struct fuse_ctx *fuse_req_ctx_compat24(fuse_req_t req); -const struct fuse_ctx *fuse_req_ctx_compat24(fuse_req_t req) -{ - return fuse_req_ctx(req); -} -//FUSE_SYMVER(".symver fuse_req_ctx_compat24,fuse_req_ctx@FUSE_2.4"); - void fuse_req_interrupt_func(fuse_req_t req, fuse_interrupt_func_t func, void *data) { @@ -1188,7 +1177,9 @@ static struct { [FUSE_OPEN] = { do_open, "OPEN" }, [FUSE_READ] = { do_read, "READ" }, [FUSE_WRITE] = { do_write, "WRITE" }, +#if HAVE_SYS_STATVFS_H [FUSE_STATFS] = { do_statfs, "STATFS" }, +#endif [FUSE_RELEASE] = { do_release, "RELEASE" }, [FUSE_FSYNC] = { do_fsync, "FSYNC" }, [FUSE_SETXATTR] = { do_setxattr, "SETXATTR" }, @@ -1332,6 +1323,15 @@ static int fuse_ll_opt_proc(void *data, const char *arg, int key, return -1; } +#ifdef __SOLARIS__ + +int fuse_lowlevel_is_lib_option(const char *opt) +{ + return fuse_opt_match(fuse_ll_opts, opt); +} + +#endif /* __SOLARIS__ */ + static void fuse_ll_destroy(void *data) { struct fuse_ll *f = (struct fuse_ll *) data; @@ -1392,4 +1392,3 @@ struct fuse_session *fuse_lowlevel_new(struct fuse_args *args, out: return NULL; } - |