summaryrefslogtreecommitdiffstats
path: root/package/fuse/patches/200-disable_compat.patch
blob: 52c0e2e2ae592748679a86bb0b6099b11591ba70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
Index: fuse-2.6.5/include/fuse_common_compat.h
===================================================================
--- fuse-2.6.5.orig/include/fuse_common_compat.h	2007-06-23 13:03:50.000000000 +0200
+++ fuse-2.6.5/include/fuse_common_compat.h	2007-06-23 13:03:51.000000000 +0200
@@ -17,6 +17,7 @@
     unsigned int keep_cache : 1;
 };
 
+#ifndef DISABLE_COMPAT
 int fuse_mount_compat25(const char *mountpoint, struct fuse_args *args);
 
 int fuse_mount_compat22(const char *mountpoint, const char *opts);
@@ -24,4 +25,4 @@
 int fuse_mount_compat1(const char *mountpoint, const char *args[]);
 
 void fuse_unmount_compat22(const char *mountpoint);
-
+#endif
Index: fuse-2.6.5/lib/fuse.c
===================================================================
--- fuse-2.6.5.orig/lib/fuse.c	2007-06-23 13:03:50.000000000 +0200
+++ fuse-2.6.5/lib/fuse.c	2007-06-23 13:03:51.000000000 +0200
@@ -128,6 +128,7 @@
 static pthread_mutex_t fuse_context_lock = PTHREAD_MUTEX_INITIALIZER;
 static int fuse_context_ref;
 
+#ifndef DISABLE_COMPAT
 static int fuse_compat_open(struct fuse *, fuse_req_t, char *,
                             struct fuse_file_info *);
 static void fuse_compat_release(struct fuse *, fuse_req_t, char *,
@@ -135,6 +136,7 @@
 static int fuse_compat_opendir(struct fuse *, fuse_req_t, char *,
                                struct fuse_file_info *);
 static int fuse_compat_statfs(struct fuse *, fuse_req_t, struct statvfs *);
+#endif
 
 static struct node *get_node_nocheck(struct fuse *f, fuse_ino_t nodeid)
 {
@@ -1509,10 +1511,12 @@
     pthread_rwlock_rdlock(&f->tree_lock);
     if (f->op.open) {
         err = -ENOENT;
+#ifndef DISABLE_COMPAT
         path = get_path(f, ino);
         if (path != NULL)
             err = fuse_compat_open(f, req, path, fi);
-    }
+#endif
+	}
     if (!err) {
         if (f->conf.debug) {
             printf("OPEN[%llu] flags: 0x%x\n", (unsigned long long) fi->fh,
@@ -1535,9 +1539,11 @@
         if (fuse_reply_open(req, fi) == -ENOENT) {
             /* The open syscall was interrupted, so it must be cancelled */
             pthread_mutex_unlock(&f->lock);
+#ifndef DISABLE_COMPAT
             if(f->op.release && path != NULL)
                 fuse_compat_release(f, req, path, fi);
-        } else {
+#endif
+		} else {
             get_node(f, ino)->open_count++;
             pthread_mutex_unlock(&f->lock);
         }
@@ -1661,8 +1667,10 @@
     }
     if (fi->flush && path && f->op.flush)
         err = fuse_do_flush(f, req, path, fi);
+#ifndef DISABLE_COMPAT
     if (f->op.release)
         fuse_compat_release(f, req, path, fi);
+#endif
 
     pthread_mutex_lock(&f->lock);
     node = get_node(f, ino);
@@ -1753,12 +1761,14 @@
 
         err = -ENOENT;
         pthread_rwlock_rdlock(&f->tree_lock);
+#ifndef DISABLE_COMPAT
         path = get_path(f, ino);
         if (path != NULL) {
             err = fuse_compat_opendir(f, req, path, &fi);
             dh->fh = fi.fh;
         }
-        if (!err) {
+#endif
+		if (!err) {
             if (fuse_reply_open(req, llfi) == -ENOENT) {
                 /* The opendir syscall was interrupted, so it must be
                    cancelled */
@@ -2011,9 +2021,12 @@
                 free(path);
             }
             pthread_rwlock_unlock(&f->tree_lock);
-        } else
+        }
+#ifndef DISABLE_COMPAT
+		else
             err = fuse_compat_statfs(f, req, &buf);
-    } else
+#endif
+	} else
         err = default_statfs(&buf);
 
     if (!err)
@@ -2691,10 +2704,12 @@
     f->conf.readdir_ino = 1;
 #endif
 
+#ifndef DISABLE_COMPAT
     if (compat && compat <= 25) {
         if (fuse_sync_compat_args(args) == -1)
             goto out_free;
     }
+#endif
 
     memcpy(&f->op, op, op_size);
     if (!f->op.lock) {
@@ -2824,6 +2839,7 @@
     fuse_delete_context_key();
 }
 
+#ifndef DISABLE_COMPAT
 #include "fuse_common_compat.h"
 #include "fuse_compat.h"
 
@@ -3037,3 +3053,5 @@
 }
 
 __asm__(".symver fuse_new_compat25,fuse_new@FUSE_2.5");
+
+#endif
Index: fuse-2.6.5/lib/fuse_lowlevel.c
===================================================================
--- fuse-2.6.5.orig/lib/fuse_lowlevel.c	2007-06-23 13:03:50.000000000 +0200
+++ fuse-2.6.5/lib/fuse_lowlevel.c	2007-06-23 13:03:51.000000000 +0200
@@ -1297,6 +1297,7 @@
 }
 
 
+#ifndef DISABLE_COMPAT
 #ifndef __FreeBSD__
 
 static void fill_open_compat(struct fuse_open_out *arg,
@@ -1422,3 +1423,4 @@
 }
 
 __asm__(".symver fuse_lowlevel_new_compat25,fuse_lowlevel_new@FUSE_2.5");
+#endif
Index: fuse-2.6.5/lib/helper.c
===================================================================
--- fuse-2.6.5.orig/lib/helper.c	2007-06-23 13:03:50.000000000 +0200
+++ fuse-2.6.5/lib/helper.c	2007-06-23 13:03:51.000000000 +0200
@@ -195,7 +195,7 @@
                                            struct fuse_args *args)
 {
     struct fuse_chan *ch;
-    int fd = fuse_mount_compat25(mountpoint, args);
+    int fd = fuse_kern_mount(mountpoint, args);
     if (fd == -1)
         return NULL;
 
@@ -338,6 +338,7 @@
     return -1;
 }
 
+#ifndef DISABLE_COMPAT
 #include "fuse_compat.h"
 
 #ifndef __FreeBSD__
@@ -431,3 +432,4 @@
 __asm__(".symver fuse_teardown_compat22,fuse_teardown@FUSE_2.2");
 __asm__(".symver fuse_main_real_compat25,fuse_main_real@FUSE_2.5");
 __asm__(".symver fuse_mount_compat25,fuse_mount@FUSE_2.5");
+#endif
Index: fuse-2.6.5/lib/mount.c
===================================================================
--- fuse-2.6.5.orig/lib/mount.c	2007-06-23 13:03:50.000000000 +0200
+++ fuse-2.6.5/lib/mount.c	2007-06-23 13:03:51.000000000 +0200
@@ -219,11 +219,16 @@
     waitpid(pid, NULL, 0);
 }
 
+#ifndef DISABLE_COMPAT
 void fuse_unmount_compat22(const char *mountpoint)
 {
     fuse_kern_unmount(mountpoint, -1);
 }
+#endif
 
+#ifdef DISABLE_COMPAT
+static
+#endif
 int fuse_mount_compat22(const char *mountpoint, const char *opts)
 {
     int fds[2], pid;
@@ -304,5 +309,7 @@
     return res;
 }
 
+#ifndef DISABLE_COMPAT
 __asm__(".symver fuse_mount_compat22,fuse_mount@FUSE_2.2");
 __asm__(".symver fuse_unmount_compat22,fuse_unmount@FUSE_2.2");
+#endif