fix
diff --git a/lib/fuse.c b/lib/fuse.c
index 7d66a7d..2cfb436 100644
--- a/lib/fuse.c
+++ b/lib/fuse.c
@@ -553,7 +553,7 @@
reply_err(req, err);
}
-static void fuse_data_init(void *data)
+static void fuse_data_init(void *data, struct fuse_conn_info *conn)
{
struct fuse *f = (struct fuse *) data;
struct fuse_context *c = fuse_get_context();
@@ -562,7 +562,7 @@
c->fuse = f;
if (f->op.init)
- f->user_data = f->op.init();
+ f->user_data = f->op.init(conn);
}
static void fuse_data_destroy(void *data)
@@ -1808,7 +1808,6 @@
enum {
KEY_HELP,
- KEY_KEEP
};
#define FUSE_LIB_OPT(t, p, v) { t, offsetof(struct fuse_config, p), v }
@@ -1816,8 +1815,8 @@
static const struct fuse_opt fuse_lib_opts[] = {
FUSE_OPT_KEY("-h", KEY_HELP),
FUSE_OPT_KEY("--help", KEY_HELP),
- FUSE_OPT_KEY("debug", KEY_KEEP),
- FUSE_OPT_KEY("-d", KEY_KEEP),
+ FUSE_OPT_KEY("debug", FUSE_OPT_KEY_KEEP),
+ FUSE_OPT_KEY("-d", FUSE_OPT_KEY_KEEP),
FUSE_LIB_OPT("debug", debug, 1),
FUSE_LIB_OPT("-d", debug, 1),
FUSE_LIB_OPT("hard_remove", hard_remove, 1),
@@ -1906,6 +1905,11 @@
f->conf.readdir_ino = 1;
#endif
+ if (compat && compat <= 25) {
+ if (fuse_sync_compat_args(args) == -1)
+ goto out_free;
+ }
+
f->se = fuse_lowlevel_new(args, &fuse_path_ops, sizeof(fuse_path_ops), f);
if (f->se == NULL)
goto out_free;
@@ -2012,13 +2016,13 @@
free(f);
}
-#ifndef __FreeBSD__
-
#include "fuse_compat.h"
+#ifndef __FreeBSD__
+
static int fuse_do_open(struct fuse *f, char *path, struct fuse_file_info *fi)
{
- if (!f->compat)
+ if (!f->compat || f->compat >= 25)
return f->op.open(path, fi);
else if (f->compat == 22) {
int err;
@@ -2045,7 +2049,7 @@
static int fuse_do_opendir(struct fuse *f, char *path,
struct fuse_file_info *fi)
{
- if (!f->compat) {
+ if (!f->compat || f->compat >= 25) {
return f->op.opendir(path, fi);
} else {
int err;
@@ -2085,7 +2089,7 @@
{
int err;
- if (!f->compat) {
+ if (!f->compat || f->compat >= 25) {
err = f->op.statfs(path, buf);
} else if (f->compat > 11) {
struct statfs oldbuf;
@@ -2179,3 +2183,13 @@
}
#endif /* __FreeBSD__ */
+
+struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
+ const struct fuse_operations_compat25 *op,
+ size_t op_size)
+{
+ return fuse_new_common(fd, args, (struct fuse_operations *) op,
+ op_size, 25);
+}
+
+__asm__(".symver fuse_new_compat25,fuse_new@FUSE_2.5");