File: fuse3.patch

package info (click to toggle)
fuseiso 20070708-7
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,168 kB
  • sloc: sh: 9,131; ansic: 2,184; makefile: 15
file content (204 lines) | stat: -rw-r--r-- 6,431 bytes parent folder | download | duplicates (2)
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
Description: Required changes to run fuseiso using fuse3
Bug-Debian: https://bugs.debian.org/1084486
Forwarded: not-needed
Author: Sven Geuer <sge@debian.org>
Last-Update: 2024-10-16
--- a/configure.in
+++ b/configure.in
@@ -7,7 +7,7 @@
 AC_PROG_CC
 AM_PROG_LIBTOOL
 
-PKG_CHECK_MODULES([FUSE],[fuse],[],[AC_MSG_ERROR([libfuse is required])])
+PKG_CHECK_MODULES([FUSE],[fuse3 >= 3.14.0],[],[AC_MSG_ERROR([libfuse3 is required])])
 PKG_CHECK_MODULES([GLIB],[glib-2.0],[],[AC_MSG_ERROR([glib-2.0 is required])])
 
 AC_OUTPUT(Makefile src/Makefile zAppRun/Makefile)
--- a/src/fuseiso.c
+++ b/src/fuseiso.c
@@ -38,7 +38,7 @@
 
 #include <linux/iso_fs.h>
 
-#define FUSE_USE_VERSION 22
+#define FUSE_USE_VERSION 314
 #include <fuse.h>
 
 #include <zlib.h>
@@ -214,7 +214,7 @@
     return 0;
 };
 
-static int isofs_getattr(const char *path, struct stat *stbuf)
+static int isofs_getattr(const char *path, struct stat *stbuf, struct fuse_file_info *UNUSED(fi))
 {
     return isofs_real_getattr(path, stbuf);
 }
@@ -238,7 +238,7 @@
     return 0;
 };
 
-static void* isofs_init() {
+static void* isofs_init(struct fuse_conn_info *UNUSED(conn), struct fuse_config *cfg) {
     int rc;
     if(maintain_mtab) {
         rc = add_mtab_record();
@@ -246,6 +246,7 @@
             exit(EXIT_FAILURE);
         };
     };
+    cfg->use_ino = 1;
     return isofs_real_init();
 };
 
@@ -261,11 +262,11 @@
 };
 
 static int isofs_readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t UNUSED(offset),
-    struct fuse_file_info *UNUSED(fi)) {
+    struct fuse_file_info *UNUSED(fi), enum fuse_readdir_flags UNUSED(flags)) {
     return isofs_real_readdir(path, buf, filler);
 };
 
-static int isofs_statfs(const char *UNUSED(path), struct statfs *stbuf)
+static int isofs_statfs(const char *UNUSED(path), struct statvfs *stbuf)
 {
     return isofs_real_statfs(stbuf);
 }
@@ -340,7 +341,7 @@
         exit(EXIT_FAILURE);
     };
     
-    imagefile = normalize_name(argv[optind]);
+    imagefile = normalize_name(argv[optind++]);
     
     image_fd = open(imagefile, O_RDONLY);
     if(image_fd == -1) {
@@ -349,42 +350,16 @@
         exit(EXIT_FAILURE);
     };
     
-    mount_point = normalize_name(argv[optind + 1]);
+    mount_point = normalize_name(argv[optind]);
     
-    // with space for possible -o use_ino arguments
-    char **nargv = (char **) malloc((argc + 2) * sizeof(char *));
-    int nargc = argc - optind;
+    int nargc = 1 + argc - optind;
+    char **nargv = (char **) malloc((nargc) * sizeof(char *));
     
     nargv[0] = argv[0];
     
     int i;
-    int next_opt = 0;
-    int use_ino_found = 0;
     for(i = 0; i < nargc - 1; ++i) {
-        if(next_opt && !use_ino_found) {
-            if(strstr(argv[i + optind + 1], "use_ino")) { // ok, already there
-                use_ino_found = 1;
-                nargv[i + 1] = argv[i + optind + 1];
-            } else { // add it
-                char* str = (char*) malloc(strlen(argv[i + optind + 1]) + 10);
-                strcpy(str, argv[i + optind + 1]);
-                strcat(str, ",use_ino");
-                nargv[i + 1] = str;
-                use_ino_found = 1;
-            };
-        } else {
-            nargv[i + 1] = argv[i + optind + 1];
-        };
-        // check if this is -o string mean that next argument should be options string
-        if(i > 1 && nargv[i + 1][0] == '-' && nargv[i + 1][1] == 'o') {
-            next_opt = 1;
-        };
-    };
-    if(!use_ino_found) {
-        nargv[nargc] = "-o";
-        nargc++;
-        nargv[nargc] = "use_ino";
-        nargc++;
+        nargv[i + 1] = argv[optind + i];
     };
     
     if(!iocharset) {
@@ -417,5 +392,5 @@
     // will exit in case of failure
     rc = isofs_real_preinit(imagefile, image_fd);
     
-    return fuse_main(nargc, nargv, &isofs_oper);
+    return fuse_main(nargc, nargv, &isofs_oper, NULL);
 };
--- a/src/isofs.h
+++ b/src/isofs.h
@@ -25,8 +25,8 @@
 #include <linux/iso_fs.h>
 #include <linux/rock.h>
 
-typedef int (*isofs_dir_fill_t) (void *buf, const char *name,
-    const struct stat *stat, off_t off);
+#define FUSE_USE_VERSION 314
+#include <fuse.h>
 
 typedef struct _isofs_context {
     char *imagefile;
@@ -154,11 +154,11 @@
 void* isofs_real_init();
 
 int isofs_real_opendir(const char *path);
-int isofs_real_readdir(const char *path, void *filler_buf, isofs_dir_fill_t filler);
+int isofs_real_readdir(const char *path, void *filler_buf, fuse_fill_dir_t filler);
 int isofs_real_getattr(const char *path, struct stat *stbuf);
 int isofs_real_readlink(const char *path, char *target, size_t size);
 int isofs_real_open(const char *path);
 int isofs_real_read(const char *path, char *out_buf, size_t size, off_t offset);
-int isofs_real_statfs(struct statfs *stbuf);
+int isofs_real_statfs(struct statvfs *stbuf);
 
 #endif // _ISOFS_H
--- a/src/isofs.c
+++ b/src/isofs.c
@@ -32,7 +32,7 @@
 #include <zlib.h>
 #include <dirent.h>
 #include <pthread.h>
-#include <sys/statfs.h>
+#include <sys/statvfs.h>
 #include <iconv.h>
 
 #include "isofs.h"
@@ -1346,7 +1346,7 @@
     return 0;
 };
 
-int isofs_real_readdir(const char *path, void *filler_buf, isofs_dir_fill_t filler) {
+int isofs_real_readdir(const char *path, void *filler_buf, fuse_fill_dir_t filler) {
     if(path[0] == '\0') {
         fprintf(stderr, "readdir: attempt to read empty path name\n");
         return -EINVAL;
@@ -1517,7 +1517,7 @@
                 struct stat st;
                 memset(& st, '\0', sizeof(struct stat));
                 isofs_direntry2stat(& st, inode);
-                rc = filler(filler_buf, entry, & st, 0);
+                rc = filler(filler_buf, entry, & st, 0, 0);
                 if(rc) {
                     printf("readdir: filler return with %d, entry %s\n", rc, entry);
                     isofs_free_inode(inode);
@@ -1820,7 +1820,7 @@
     return total_size;
 };
 
-int isofs_real_statfs(struct statfs *stbuf) {
+int isofs_real_statfs(struct statvfs *stbuf) {
     stbuf->f_type = ISOFS_SUPER_MAGIC;
     stbuf->f_bsize = context.data_size; // or PAGE_CACHE_SIZE?
     stbuf->f_blocks = 0; // while it is possible to calculate this, i see no reasons to do so
@@ -1828,6 +1828,7 @@
     stbuf->f_bavail = 0;
     stbuf->f_files = 0;
     stbuf->f_ffree = 0;
-    stbuf->f_namelen = NAME_MAX - 1; // ? not sure..
+    stbuf->f_favail = 0;
+    stbuf->f_namemax = NAME_MAX - 1; // ? not sure..
     return 0;
 };