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