1 Index: fuse-2.6.5/include/fuse_common_compat.h
2 ===================================================================
3 --- fuse-2.6.5.orig/include/fuse_common_compat.h 2007-06-23 13:03:50.000000000 +0200
4 +++ fuse-2.6.5/include/fuse_common_compat.h 2007-06-23 13:03:51.000000000 +0200
6 unsigned int keep_cache : 1;
9 +#ifndef DISABLE_COMPAT
10 int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args);
12 int fuse_mount_compat22(const char *mountpoint, const char *opts);
14 int fuse_mount_compat1(const char *mountpoint, const char *args[]);
16 void fuse_unmount_compat22(const char *mountpoint);
19 Index: fuse-2.6.5/lib/fuse.c
20 ===================================================================
21 --- fuse-2.6.5.orig/lib/fuse.c 2007-06-23 13:03:50.000000000 +0200
22 +++ fuse-2.6.5/lib/fuse.c 2007-06-23 13:03:51.000000000 +0200
24 static pthread_mutex_t fuse_context_lock = PTHREAD_MUTEX_INITIALIZER;
25 static int fuse_context_ref;
27 +#ifndef DISABLE_COMPAT
28 static int fuse_compat_open(struct fuse *, fuse_req_t, char *,
29 struct fuse_file_info *);
30 static void fuse_compat_release(struct fuse *, fuse_req_t, char *,
32 static int fuse_compat_opendir(struct fuse *, fuse_req_t, char *,
33 struct fuse_file_info *);
34 static int fuse_compat_statfs(struct fuse *, fuse_req_t, struct statvfs *);
37 static struct node *get_node_nocheck(struct fuse *f, fuse_ino_t nodeid)
39 @@ -1509,10 +1511,12 @@
40 pthread_rwlock_rdlock(&f->tree_lock);
43 +#ifndef DISABLE_COMPAT
44 path = get_path(f, ino);
46 err = fuse_compat_open(f, req, path, fi);
52 printf("OPEN[%llu] flags: 0x%x\n", (unsigned long long) fi->fh,
53 @@ -1535,9 +1539,11 @@
54 if (fuse_reply_open(req, fi) == -ENOENT) {
55 /* The open syscall was interrupted, so it must be cancelled */
56 pthread_mutex_unlock(&f->lock);
57 +#ifndef DISABLE_COMPAT
58 if(f->op.release && path != NULL)
59 fuse_compat_release(f, req, path, fi);
63 get_node(f, ino)->open_count++;
64 pthread_mutex_unlock(&f->lock);
66 @@ -1661,8 +1667,10 @@
68 if (fi->flush && path && f->op.flush)
69 err = fuse_do_flush(f, req, path, fi);
70 +#ifndef DISABLE_COMPAT
72 fuse_compat_release(f, req, path, fi);
75 pthread_mutex_lock(&f->lock);
76 node = get_node(f, ino);
77 @@ -1753,12 +1761,14 @@
80 pthread_rwlock_rdlock(&f->tree_lock);
81 +#ifndef DISABLE_COMPAT
82 path = get_path(f, ino);
84 err = fuse_compat_opendir(f, req, path, &fi);
90 if (fuse_reply_open(req, llfi) == -ENOENT) {
91 /* The opendir syscall was interrupted, so it must be
93 @@ -2011,9 +2021,12 @@
96 pthread_rwlock_unlock(&f->tree_lock);
99 +#ifndef DISABLE_COMPAT
101 err = fuse_compat_statfs(f, req, &buf);
105 err = default_statfs(&buf);
108 @@ -2691,10 +2704,12 @@
109 f->conf.readdir_ino = 1;
112 +#ifndef DISABLE_COMPAT
113 if (compat && compat <= 25) {
114 if (fuse_sync_compat_args(args) == -1)
119 memcpy(&f->op, op, op_size);
121 @@ -2824,6 +2839,7 @@
122 fuse_delete_context_key();
125 +#ifndef DISABLE_COMPAT
126 #include "fuse_common_compat.h"
127 #include "fuse_compat.h"
129 @@ -3037,3 +3053,5 @@
132 __asm__(".symver fuse_new_compat25,fuse_new@FUSE_2.5");
135 Index: fuse-2.6.5/lib/fuse_lowlevel.c
136 ===================================================================
137 --- fuse-2.6.5.orig/lib/fuse_lowlevel.c 2007-06-23 13:03:50.000000000 +0200
138 +++ fuse-2.6.5/lib/fuse_lowlevel.c 2007-06-23 13:03:51.000000000 +0200
139 @@ -1297,6 +1297,7 @@
143 +#ifndef DISABLE_COMPAT
146 static void fill_open_compat(struct fuse_open_out *arg,
147 @@ -1422,3 +1423,4 @@
150 __asm__(".symver fuse_lowlevel_new_compat25,fuse_lowlevel_new@FUSE_2.5");
152 Index: fuse-2.6.5/lib/helper.c
153 ===================================================================
154 --- fuse-2.6.5.orig/lib/helper.c 2007-06-23 13:03:50.000000000 +0200
155 +++ fuse-2.6.5/lib/helper.c 2007-06-23 13:03:51.000000000 +0200
157 struct fuse_args *args)
159 struct fuse_chan *ch;
160 - int fd = fuse_mount_compat25(mountpoint, args);
161 + int fd = fuse_kern_mount(mountpoint, args);
169 +#ifndef DISABLE_COMPAT
170 #include "fuse_compat.h"
174 __asm__(".symver fuse_teardown_compat22,fuse_teardown@FUSE_2.2");
175 __asm__(".symver fuse_main_real_compat25,fuse_main_real@FUSE_2.5");
176 __asm__(".symver fuse_mount_compat25,fuse_mount@FUSE_2.5");
178 Index: fuse-2.6.5/lib/mount.c
179 ===================================================================
180 --- fuse-2.6.5.orig/lib/mount.c 2007-06-23 13:03:50.000000000 +0200
181 +++ fuse-2.6.5/lib/mount.c 2007-06-23 13:03:51.000000000 +0200
182 @@ -219,11 +219,16 @@
183 waitpid(pid, NULL, 0);
186 +#ifndef DISABLE_COMPAT
187 void fuse_unmount_compat22(const char *mountpoint)
189 fuse_kern_unmount(mountpoint, -1);
193 +#ifdef DISABLE_COMPAT
196 int fuse_mount_compat22(const char *mountpoint, const char *opts)
203 +#ifndef DISABLE_COMPAT
204 __asm__(".symver fuse_mount_compat22,fuse_mount@FUSE_2.2");
205 __asm__(".symver fuse_unmount_compat22,fuse_unmount@FUSE_2.2");