2008-04-01 20:02:27 +00:00
|
|
|
diff -Nru fuse-2.7.3.orig/include/fuse_common_compat.h fuse-2.7.3/include/fuse_common_compat.h
|
|
|
|
--- fuse-2.7.3.orig/include/fuse_common_compat.h 2008-02-19 14:51:23.000000000 -0500
|
|
|
|
+++ fuse-2.7.3/include/fuse_common_compat.h 2008-03-17 14:55:01.000000000 -0400
|
2007-02-27 15:13:59 +00:00
|
|
|
@@ -17,6 +17,7 @@
|
2008-04-01 20:02:27 +00:00
|
|
|
unsigned int keep_cache : 1;
|
2007-02-27 15:13:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
+#ifndef DISABLE_COMPAT
|
|
|
|
int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args);
|
|
|
|
|
|
|
|
int fuse_mount_compat22(const char *mountpoint, const char *opts);
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -24,3 +25,4 @@
|
2007-02-27 15:13:59 +00:00
|
|
|
int fuse_mount_compat1(const char *mountpoint, const char *args[]);
|
|
|
|
|
|
|
|
void fuse_unmount_compat22(const char *mountpoint);
|
|
|
|
+#endif
|
2008-04-01 20:02:27 +00:00
|
|
|
diff -Nru fuse-2.7.3.orig/lib/fuse.c fuse-2.7.3/lib/fuse.c
|
|
|
|
--- fuse-2.7.3.orig/lib/fuse.c 2008-02-19 14:51:25.000000000 -0500
|
|
|
|
+++ fuse-2.7.3/lib/fuse.c 2008-03-17 15:04:54.000000000 -0400
|
2007-10-20 15:30:08 +00:00
|
|
|
@@ -14,8 +14,6 @@
|
|
|
|
#include "fuse_lowlevel.h"
|
|
|
|
#include "fuse_opt.h"
|
|
|
|
#include "fuse_misc.h"
|
|
|
|
-#include "fuse_common_compat.h"
|
|
|
|
-#include "fuse_compat.h"
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -626,129 +624,6 @@
|
|
|
|
fuse_do_prepare_interrupt(req, d);
|
2007-10-20 15:30:08 +00:00
|
|
|
}
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
-#ifndef __FreeBSD__
|
|
|
|
-
|
|
|
|
-static int fuse_compat_open(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
|
|
|
-{
|
|
|
|
- int err;
|
|
|
|
- if (!fs->compat || fs->compat >= 25)
|
|
|
|
- err = fs->op.open(path, fi);
|
|
|
|
- else if (fs->compat == 22) {
|
|
|
|
- struct fuse_file_info_compat tmp;
|
|
|
|
- memcpy(&tmp, fi, sizeof(tmp));
|
|
|
|
- err = ((struct fuse_operations_compat22 *) &fs->op)->open(path,
|
|
|
|
- &tmp);
|
|
|
|
- memcpy(fi, &tmp, sizeof(tmp));
|
|
|
|
- fi->fh = tmp.fh;
|
|
|
|
- } else
|
|
|
|
- err = ((struct fuse_operations_compat2 *) &fs->op)
|
|
|
|
- ->open(path, fi->flags);
|
|
|
|
- return err;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int fuse_compat_release(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (!fs->compat || fs->compat >= 22)
|
|
|
|
- return fs->op.release(path, fi);
|
|
|
|
- else
|
|
|
|
- return ((struct fuse_operations_compat2 *) &fs->op)
|
|
|
|
- ->release(path, fi->flags);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int fuse_compat_opendir(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
|
|
|
-{
|
|
|
|
- if (!fs->compat || fs->compat >= 25)
|
|
|
|
- return fs->op.opendir(path, fi);
|
|
|
|
- else {
|
|
|
|
- int err;
|
|
|
|
- struct fuse_file_info_compat tmp;
|
|
|
|
- memcpy(&tmp, fi, sizeof(tmp));
|
|
|
|
- err = ((struct fuse_operations_compat22 *) &fs->op)
|
|
|
|
- ->opendir(path, &tmp);
|
|
|
|
- memcpy(fi, &tmp, sizeof(tmp));
|
|
|
|
- fi->fh = tmp.fh;
|
|
|
|
- return err;
|
|
|
|
- }
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void convert_statfs_compat(struct fuse_statfs_compat1 *compatbuf,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct statvfs *stbuf)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- stbuf->f_bsize = compatbuf->block_size;
|
|
|
|
- stbuf->f_blocks = compatbuf->blocks;
|
|
|
|
- stbuf->f_bfree = compatbuf->blocks_free;
|
|
|
|
- stbuf->f_bavail = compatbuf->blocks_free;
|
|
|
|
- stbuf->f_files = compatbuf->files;
|
|
|
|
- stbuf->f_ffree = compatbuf->files_free;
|
|
|
|
- stbuf->f_namemax = compatbuf->namelen;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void convert_statfs_old(struct statfs *oldbuf, struct statvfs *stbuf)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- stbuf->f_bsize = oldbuf->f_bsize;
|
|
|
|
- stbuf->f_blocks = oldbuf->f_blocks;
|
|
|
|
- stbuf->f_bfree = oldbuf->f_bfree;
|
|
|
|
- stbuf->f_bavail = oldbuf->f_bavail;
|
|
|
|
- stbuf->f_files = oldbuf->f_files;
|
|
|
|
- stbuf->f_ffree = oldbuf->f_ffree;
|
|
|
|
- stbuf->f_namemax = oldbuf->f_namelen;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int fuse_compat_statfs(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct statvfs *buf)
|
|
|
|
-{
|
|
|
|
- int err;
|
|
|
|
-
|
|
|
|
- if (!fs->compat || fs->compat >= 25) {
|
|
|
|
- err = fs->op.statfs(fs->compat == 25 ? "/" : path, buf);
|
|
|
|
- } else if (fs->compat > 11) {
|
|
|
|
- struct statfs oldbuf;
|
|
|
|
- err = ((struct fuse_operations_compat22 *) &fs->op)
|
|
|
|
- ->statfs("/", &oldbuf);
|
|
|
|
- if (!err)
|
|
|
|
- convert_statfs_old(&oldbuf, buf);
|
|
|
|
- } else {
|
|
|
|
- struct fuse_statfs_compat1 compatbuf;
|
|
|
|
- memset(&compatbuf, 0, sizeof(struct fuse_statfs_compat1));
|
|
|
|
- err = ((struct fuse_operations_compat1 *) &fs->op)
|
|
|
|
- ->statfs(&compatbuf);
|
|
|
|
- if (!err)
|
|
|
|
- convert_statfs_compat(&compatbuf, buf);
|
|
|
|
- }
|
|
|
|
- return err;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#else /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
-static inline int fuse_compat_open(struct fuse_fs *fs, char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fs->op.open(path, fi);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static inline int fuse_compat_release(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fs->op.release(path, fi);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static inline int fuse_compat_opendir(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_file_info *fi)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fs->op.opendir(path, fi);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static inline int fuse_compat_statfs(struct fuse_fs *fs, const char *path,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct statvfs *buf)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fs->op.statfs(fs->compat == 25 ? "/" : path, buf);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#endif /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct stat *buf)
|
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
fuse_get_context()->private_data = fs->user_data;
|
|
|
|
@@ -821,7 +696,7 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
fuse_get_context()->private_data = fs->user_data;
|
|
|
|
if (fs->op.release)
|
|
|
|
- return fuse_compat_release(fs, path, fi);
|
|
|
|
+ return fs->op.release(path, fi);
|
|
|
|
else
|
|
|
|
return 0;
|
2007-10-20 15:30:08 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -831,7 +706,7 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
fuse_get_context()->private_data = fs->user_data;
|
|
|
|
if (fs->op.opendir)
|
|
|
|
- return fuse_compat_opendir(fs, path, fi);
|
|
|
|
+ return fs->op.opendir(path, fi);
|
|
|
|
else
|
|
|
|
return 0;
|
2007-10-20 15:30:08 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -841,7 +716,7 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
fuse_get_context()->private_data = fs->user_data;
|
|
|
|
if (fs->op.open)
|
|
|
|
- return fuse_compat_open(fs, path, fi);
|
|
|
|
+ return fs->op.open(path, fi);
|
|
|
|
else
|
|
|
|
return 0;
|
2007-10-20 15:30:08 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -900,7 +775,7 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
fuse_get_context()->private_data = fs->user_data;
|
|
|
|
if (fs->op.statfs)
|
|
|
|
- return fuse_compat_statfs(fs, path, buf);
|
|
|
|
+ return fs->op.statfs(path, buf);
|
|
|
|
else {
|
|
|
|
buf->f_namemax = 255;
|
|
|
|
buf->f_bsize = 512;
|
|
|
|
@@ -3070,7 +2945,6 @@
|
|
|
|
if (!fs)
|
|
|
|
goto out_free;
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2008-04-01 20:02:27 +00:00
|
|
|
- fs->compat = compat;
|
|
|
|
f->fs = fs;
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2008-04-01 20:02:27 +00:00
|
|
|
/* Oh f**k, this is ugly! */
|
|
|
|
@@ -3114,11 +2988,6 @@
|
|
|
|
f->conf.readdir_ino = 1;
|
2007-02-27 15:13:59 +00:00
|
|
|
#endif
|
|
|
|
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (compat && compat <= 25) {
|
|
|
|
- if (fuse_sync_compat_args(args) == -1)
|
|
|
|
- goto out_free_fs;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
f->se = fuse_lowlevel_new_common(args, &llop, sizeof(llop), f);
|
|
|
|
if (f->se == NULL) {
|
|
|
|
if (f->conf.help)
|
|
|
|
@@ -3254,19 +3123,6 @@
|
|
|
|
fuse_delete_context_key();
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
-static struct fuse *fuse_new_common_compat25(int fd, struct fuse_args *args,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations *op,
|
|
|
|
- size_t op_size, int compat)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse *f = NULL;
|
|
|
|
- struct fuse_chan *ch = fuse_kern_chan_new(fd);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (ch)
|
|
|
|
- f = fuse_new_common(ch, args, op, op_size, NULL, compat);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- return f;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
/* called with fuse_context_lock held or during initialization (before
|
|
|
|
main() has been called) */
|
|
|
|
void fuse_register_module(struct fuse_module *mod)
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -3278,72 +3134,3 @@
|
|
|
|
mod->next = fuse_modules;
|
|
|
|
fuse_modules = mod;
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
-
|
2007-10-20 15:30:08 +00:00
|
|
|
-#ifndef __FreeBSD__
|
|
|
|
-
|
|
|
|
-static struct fuse *fuse_new_common_compat(int fd, const char *opts,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations *op,
|
|
|
|
- size_t op_size, int compat)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse *f;
|
|
|
|
- struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (fuse_opt_add_arg(&args, "") == -1)
|
|
|
|
- return NULL;
|
|
|
|
- if (opts &&
|
|
|
|
- (fuse_opt_add_arg(&args, "-o") == -1 ||
|
|
|
|
- fuse_opt_add_arg(&args, opts) == -1)) {
|
|
|
|
- fuse_opt_free_args(&args);
|
|
|
|
- return NULL;
|
|
|
|
- }
|
|
|
|
- f = fuse_new_common_compat25(fd, &args, op, op_size, compat);
|
|
|
|
- fuse_opt_free_args(&args);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- return f;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_new_compat22(int fd, const char *opts,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat22 *op,
|
|
|
|
- size_t op_size)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_new_common_compat(fd, opts, (struct fuse_operations *) op,
|
|
|
|
- op_size, 22);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_new_compat2(int fd, const char *opts,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat2 *op)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_new_common_compat(fd, opts, (struct fuse_operations *) op,
|
|
|
|
- sizeof(struct fuse_operations_compat2),
|
|
|
|
- 21);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_new_compat1(int fd, int flags,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat1 *op)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- const char *opts = NULL;
|
|
|
|
- if (flags & FUSE_DEBUG_COMPAT1)
|
|
|
|
- opts = "debug";
|
|
|
|
- return fuse_new_common_compat(fd, opts, (struct fuse_operations *) op,
|
|
|
|
- sizeof(struct fuse_operations_compat1),
|
|
|
|
- 11);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_exited,__fuse_exited@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_process_cmd,__fuse_process_cmd@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_read_cmd,__fuse_read_cmd@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_set_getcontext_func,__fuse_set_getcontext_func@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_new_compat2,fuse_new@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_new_compat22,fuse_new@FUSE_2.2");
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
|
|
|
-#endif /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_new_compat25(int fd, struct fuse_args *args,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat25 *op,
|
|
|
|
- size_t op_size)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_new_common_compat25(fd, args, (struct fuse_operations *) op,
|
|
|
|
- op_size, 25);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_new_compat25,fuse_new@FUSE_2.5");
|
|
|
|
diff -Nru fuse-2.7.3.orig/lib/fuse_lowlevel.c fuse-2.7.3/lib/fuse_lowlevel.c
|
|
|
|
--- fuse-2.7.3.orig/lib/fuse_lowlevel.c 2008-02-19 14:51:26.000000000 -0500
|
|
|
|
+++ fuse-2.7.3/lib/fuse_lowlevel.c 2008-03-17 15:07:40.000000000 -0400
|
2007-10-20 15:30:08 +00:00
|
|
|
@@ -11,8 +11,6 @@
|
|
|
|
#include "fuse_opt.h"
|
|
|
|
#include "fuse_i.h"
|
|
|
|
#include "fuse_misc.h"
|
|
|
|
-#include "fuse_common_compat.h"
|
|
|
|
-#include "fuse_lowlevel_compat.h"
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -1319,130 +1317,3 @@
|
|
|
|
{
|
|
|
|
return fuse_lowlevel_new_common(args, op, op_size, userdata);
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
-
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
|
|
|
-#ifndef __FreeBSD__
|
|
|
|
-
|
|
|
|
-static void fill_open_compat(struct fuse_open_out *arg,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_file_info_compat *f)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- arg->fh = f->fh;
|
|
|
|
- if (f->direct_io)
|
|
|
|
- arg->open_flags |= FOPEN_DIRECT_IO;
|
|
|
|
- if (f->keep_cache)
|
|
|
|
- arg->open_flags |= FOPEN_KEEP_CACHE;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static void convert_statfs_compat(const struct statfs *compatbuf,
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct statvfs *buf)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- buf->f_bsize = compatbuf->f_bsize;
|
|
|
|
- buf->f_blocks = compatbuf->f_blocks;
|
|
|
|
- buf->f_bfree = compatbuf->f_bfree;
|
|
|
|
- buf->f_bavail = compatbuf->f_bavail;
|
|
|
|
- buf->f_files = compatbuf->f_files;
|
|
|
|
- buf->f_ffree = compatbuf->f_ffree;
|
|
|
|
- buf->f_namemax = compatbuf->f_namelen;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_reply_open_compat(fuse_req_t req,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_file_info_compat *f)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_open_out arg;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- memset(&arg, 0, sizeof(arg));
|
|
|
|
- fill_open_compat(&arg, f);
|
|
|
|
- return send_reply_ok(req, &arg, sizeof(arg));
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_reply_statfs_compat(fuse_req_t req, const struct statfs *stbuf)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct statvfs newbuf;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- memset(&newbuf, 0, sizeof(newbuf));
|
|
|
|
- convert_statfs_compat(stbuf, &newbuf);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_reply_statfs(req, &newbuf);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse_session *fuse_lowlevel_new_compat(const char *opts,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_lowlevel_ops_compat *op,
|
|
|
|
- size_t op_size, void *userdata)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_session *se;
|
|
|
|
- struct fuse_args args = FUSE_ARGS_INIT(0, NULL);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (opts &&
|
|
|
|
- (fuse_opt_add_arg(&args, "") == -1 ||
|
|
|
|
- fuse_opt_add_arg(&args, "-o") == -1 ||
|
|
|
|
- fuse_opt_add_arg(&args, opts) == -1)) {
|
|
|
|
- fuse_opt_free_args(&args);
|
|
|
|
- return NULL;
|
|
|
|
- }
|
|
|
|
- se = fuse_lowlevel_new(&args, (const struct fuse_lowlevel_ops *) op,
|
|
|
|
- op_size, userdata);
|
|
|
|
- fuse_opt_free_args(&args);
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- return se;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse_ll_compat_conf {
|
2008-04-01 20:02:27 +00:00
|
|
|
- unsigned max_read;
|
|
|
|
- int set_max_read;
|
2007-10-20 15:30:08 +00:00
|
|
|
-};
|
|
|
|
-
|
|
|
|
-static const struct fuse_opt fuse_ll_opts_compat[] = {
|
2008-04-01 20:02:27 +00:00
|
|
|
- { "max_read=", offsetof(struct fuse_ll_compat_conf, set_max_read), 1 },
|
|
|
|
- { "max_read=%u", offsetof(struct fuse_ll_compat_conf, max_read), 0 },
|
|
|
|
- FUSE_OPT_KEY("max_read=", FUSE_OPT_KEY_KEEP),
|
|
|
|
- FUSE_OPT_END
|
2007-10-20 15:30:08 +00:00
|
|
|
-};
|
|
|
|
-
|
|
|
|
-int fuse_sync_compat_args(struct fuse_args *args)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- struct fuse_ll_compat_conf conf;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- memset(&conf, 0, sizeof(conf));
|
|
|
|
- if (fuse_opt_parse(args, &conf, fuse_ll_opts_compat, NULL) == -1)
|
|
|
|
- return -1;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (fuse_opt_insert_arg(args, 1, "-osync_read"))
|
|
|
|
- return -1;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (conf.set_max_read) {
|
|
|
|
- char tmpbuf[64];
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- sprintf(tmpbuf, "-omax_readahead=%u", conf.max_read);
|
|
|
|
- if (fuse_opt_insert_arg(args, 1, tmpbuf) == -1)
|
|
|
|
- return -1;
|
|
|
|
- }
|
|
|
|
- return 0;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_reply_statfs_compat,fuse_reply_statfs@FUSE_2.4");
|
|
|
|
-FUSE_SYMVER(".symver fuse_reply_open_compat,fuse_reply_open@FUSE_2.4");
|
|
|
|
-FUSE_SYMVER(".symver fuse_lowlevel_new_compat,fuse_lowlevel_new@FUSE_2.4");
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
|
|
|
-#else /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
-int fuse_sync_compat_args(struct fuse_args *args)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- (void) args;
|
|
|
|
- return 0;
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-#endif /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
-struct fuse_session *fuse_lowlevel_new_compat25(struct fuse_args *args,
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_lowlevel_ops_compat25 *op,
|
|
|
|
- size_t op_size, void *userdata)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- if (fuse_sync_compat_args(args) == -1)
|
|
|
|
- return NULL;
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_lowlevel_new_common(args,
|
|
|
|
- (const struct fuse_lowlevel_ops *) op,
|
|
|
|
- op_size, userdata);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_lowlevel_new_compat25,fuse_lowlevel_new@FUSE_2.5");
|
|
|
|
diff -Nru fuse-2.7.3.orig/lib/helper.c fuse-2.7.3/lib/helper.c
|
|
|
|
--- fuse-2.7.3.orig/lib/helper.c 2008-02-19 14:51:27.000000000 -0500
|
|
|
|
+++ fuse-2.7.3/lib/helper.c 2008-03-17 15:10:18.000000000 -0400
|
|
|
|
@@ -11,7 +11,6 @@
|
|
|
|
#include "fuse_misc.h"
|
2007-10-20 15:30:08 +00:00
|
|
|
#include "fuse_opt.h"
|
|
|
|
#include "fuse_lowlevel.h"
|
|
|
|
-#include "fuse_common_compat.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -206,7 +205,7 @@
|
|
|
|
close(fd);
|
|
|
|
} while (fd >= 0 && fd <= 2);
|
2007-10-20 15:30:08 +00:00
|
|
|
|
2008-04-01 20:02:27 +00:00
|
|
|
- fd = fuse_mount_compat25(mountpoint, args);
|
|
|
|
+ fd = fuse_kern_mount(mountpoint, args);
|
|
|
|
if (fd == -1)
|
|
|
|
return NULL;
|
2007-02-27 15:13:59 +00:00
|
|
|
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -353,100 +352,3 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
return FUSE_VERSION;
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
|
|
|
-#include "fuse_compat.h"
|
|
|
|
-
|
|
|
|
-#ifndef __FreeBSD__
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_setup_compat22(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat22 *op,
|
|
|
|
- size_t op_size, char **mountpoint,
|
|
|
|
- int *multithreaded, int *fd)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_setup_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- op_size, mountpoint, multithreaded, fd, NULL,
|
|
|
|
- 22);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_setup_compat2(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat2 *op,
|
|
|
|
- char **mountpoint, int *multithreaded,
|
|
|
|
- int *fd)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_setup_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- sizeof(struct fuse_operations_compat2),
|
|
|
|
- mountpoint, multithreaded, fd, NULL, 21);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_main_real_compat22(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat22 *op,
|
|
|
|
- size_t op_size)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_main_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- op_size, NULL, 22);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void fuse_main_compat1(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat1 *op)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- fuse_main_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- sizeof(struct fuse_operations_compat1), NULL, 11);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_main_compat2(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat2 *op)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_main_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- sizeof(struct fuse_operations_compat2), NULL,
|
|
|
|
- 21);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_mount_compat1(const char *mountpoint, const char *args[])
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- /* just ignore mount args for now */
|
|
|
|
- (void) args;
|
|
|
|
- return fuse_mount_compat22(mountpoint, NULL);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_setup_compat2,__fuse_setup@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_setup_compat22,fuse_setup@FUSE_2.2");
|
|
|
|
-FUSE_SYMVER(".symver fuse_teardown,__fuse_teardown@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_main_compat2,fuse_main@");
|
|
|
|
-FUSE_SYMVER(".symver fuse_main_real_compat22,fuse_main_real@FUSE_2.2");
|
2007-10-20 15:30:08 +00:00
|
|
|
-
|
|
|
|
-#endif /* __FreeBSD__ */
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-struct fuse *fuse_setup_compat25(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat25 *op,
|
|
|
|
- size_t op_size, char **mountpoint,
|
|
|
|
- int *multithreaded, int *fd)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_setup_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- op_size, mountpoint, multithreaded, fd, NULL,
|
|
|
|
- 25);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_main_real_compat25(int argc, char *argv[],
|
2008-04-01 20:02:27 +00:00
|
|
|
- const struct fuse_operations_compat25 *op,
|
|
|
|
- size_t op_size)
|
2007-10-20 15:30:08 +00:00
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_main_common(argc, argv, (struct fuse_operations *) op,
|
|
|
|
- op_size, NULL, 25);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-void fuse_teardown_compat22(struct fuse *fuse, int fd, char *mountpoint)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- (void) fd;
|
|
|
|
- fuse_teardown_common(fuse, mountpoint);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
-int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_kern_mount(mountpoint, args);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
2008-04-01 20:02:27 +00:00
|
|
|
-FUSE_SYMVER(".symver fuse_setup_compat25,fuse_setup@FUSE_2.5");
|
|
|
|
-FUSE_SYMVER(".symver fuse_teardown_compat22,fuse_teardown@FUSE_2.2");
|
|
|
|
-FUSE_SYMVER(".symver fuse_main_real_compat25,fuse_main_real@FUSE_2.5");
|
|
|
|
-FUSE_SYMVER(".symver fuse_mount_compat25,fuse_mount@FUSE_2.5");
|
|
|
|
diff -Nru fuse-2.7.3.orig/lib/mount.c fuse-2.7.3/lib/mount.c
|
|
|
|
--- fuse-2.7.3.orig/lib/mount.c 2008-02-19 14:51:27.000000000 -0500
|
|
|
|
+++ fuse-2.7.3/lib/mount.c 2008-03-17 15:11:02.000000000 -0400
|
|
|
|
@@ -10,7 +10,6 @@
|
2007-10-20 15:30:08 +00:00
|
|
|
#include "fuse_i.h"
|
2008-04-01 20:02:27 +00:00
|
|
|
#include "fuse_misc.h"
|
2007-10-20 15:30:08 +00:00
|
|
|
#include "fuse_opt.h"
|
|
|
|
-#include "fuse_common_compat.h"
|
|
|
|
#include "mount_util.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -312,11 +311,6 @@
|
|
|
|
waitpid(pid, NULL, 0);
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
-void fuse_unmount_compat22(const char *mountpoint)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- fuse_kern_unmount(mountpoint, -1);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int fuse_mount_fusermount(const char *mountpoint, const char *opts,
|
2008-04-01 20:02:27 +00:00
|
|
|
int quiet)
|
2007-02-27 15:13:59 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -380,11 +374,6 @@
|
|
|
|
return rv;
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
|
|
|
|
2007-10-20 15:30:08 +00:00
|
|
|
-int fuse_mount_compat22(const char *mountpoint, const char *opts)
|
|
|
|
-{
|
2008-04-01 20:02:27 +00:00
|
|
|
- return fuse_mount_fusermount(mountpoint, opts, 0);
|
2007-10-20 15:30:08 +00:00
|
|
|
-}
|
|
|
|
-
|
|
|
|
static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
|
2008-04-01 20:02:27 +00:00
|
|
|
const char *mnt_opts)
|
2007-02-27 15:13:59 +00:00
|
|
|
{
|
2008-04-01 20:02:27 +00:00
|
|
|
@@ -587,6 +576,3 @@
|
|
|
|
free(mo.mtab_opts);
|
|
|
|
return res;
|
2007-02-27 15:13:59 +00:00
|
|
|
}
|
2008-04-01 20:02:27 +00:00
|
|
|
-
|
|
|
|
-FUSE_SYMVER(".symver fuse_mount_compat22,fuse_mount@FUSE_2.2");
|
|
|
|
-FUSE_SYMVER(".symver fuse_unmount_compat22,fuse_unmount@FUSE_2.2");
|