Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 324 lines (286 sloc) 11.209 kb
4d4d90b @hzeller o More legalese
authored
1 // Folve - A fuse filesystem that convolves audio files on-the-fly.
2 //
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
3 // Copyright (C) 2012 Henner Zeller <h.zeller@acm.org>
1bce634 @hzeller o Remove some trailing whitespaces
authored
4 //
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 // Use latest version.
19 #define FUSE_USE_VERSION 26
49a4cd9 @hzeller o Provide an INSTALL.md that explains how to compile on older systems.
authored
20 #include <fuse/fuse.h>
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
21
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
22 #include <dirent.h>
23 #include <errno.h>
b698853 @hzeller o README updates.
authored
24 #include <fcntl.h>
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
25 #include <limits.h>
b698853 @hzeller o README updates.
authored
26 #include <stdio.h>
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
27 #include <stdlib.h>
b698853 @hzeller o README updates.
authored
28 #include <string.h>
29 #include <sys/stat.h>
30 #include <sys/time.h>
49eca7f @hzeller o add syslog as preparation for parameter handling.
authored
31 #include <syslog.h>
b698853 @hzeller o README updates.
authored
32 #include <unistd.h>
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
33
a9d3e53 @hzeller o Found a project name: "Folve". Some renamings because of that.
authored
34 #include "folve-filesystem.h"
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
35 #include "status-server.h"
7689c9a @hzeller o preparation to extract classes from folve-filesystem into their
authored
36 #include "util.h"
e9c07dd @hzeller o add documentation
authored
37
6c6dedb @hzeller o Some readme tweaks and readability improvements.
authored
38 // Compilation unit variables to communicate with the fuse callbacks.
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
39 static struct FolveRuntime {
a372a03 @hzeller o Make meta-refresh configurable.
authored
40 FolveRuntime() : fs(NULL), mount_point(NULL),
fa525ee @hzeller o If we find problems in the options, complain and exit.
authored
41 status_port(-1), refresh_time(10), parameter_error(false) {}
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
42 FolveFilesystem *fs;
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
43 const char *mount_point;
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
44 int status_port;
a372a03 @hzeller o Make meta-refresh configurable.
authored
45 int refresh_time;
fa525ee @hzeller o If we find problems in the options, complain and exit.
authored
46 bool parameter_error;
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
47 } folve_rt;
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
48
7c7bda6 @hzeller o attempt to create a sndfile for every file, if that fails, fall
authored
49 static char *concat_path(char *buf, const char *a, const char *b) {
50 strcpy(buf, a);
51 strcat(buf, b);
52 return buf;
53 }
54
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
55 // Given a relative path from the root of the mounted file-system, get the
56 // original file from the source filesystem.
57 static const char *assemble_orig_path(char *buf, const char *path) {
08bbf28 @hzeller o First shot at gapless. Works pretty well for my test-case.
authored
58 return concat_path(buf, folve_rt.fs->underlying_dir().c_str(), path);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
59 }
60
7c7bda6 @hzeller o attempt to create a sndfile for every file, if that fails, fall
authored
61 // Essentially lstat(). Just forward to the original filesystem (this
73093dc @hzeller o Keep open file-descriptor.
authored
62 // will by lying: our convolved files are of different size...)
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
63 static int folve_getattr(const char *path, struct stat *stbuf) {
9a8ea56 @hzeller o add infrastructure to provide Stat() output of currently open
authored
64 // If this is a currently open filename, we might be able to output a better
65 // estimate.
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
66 int result = folve_rt.fs->StatByFilename(path, stbuf);
369a0a7 @hzeller o Writing is not possible. Show permissions as readonly.
authored
67 if (result != 0) {
68 char path_buf[PATH_MAX];
69 result = lstat(assemble_orig_path(path_buf, path), stbuf);
70 if (result == -1)
71 return -errno;
72 }
73 // Whatever write mode was there before: now things are readonly.
74 stbuf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
75 return 0;
76 }
77
73093dc @hzeller o Keep open file-descriptor.
authored
78 // readdir(). Just forward to original filesystem.
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
79 static int folve_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
80 off_t offset, struct fuse_file_info *fi) {
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
81 DIR *dp;
82 struct dirent *de;
83 char path_buf[PATH_MAX];
84
85 dp = opendir(assemble_orig_path(path_buf, path));
86 if (dp == NULL)
87 return -errno;
88
bf030af @hzeller o use readdir_r() - looks like readdir is indeed not really multi-thread
authored
89 // Entry size is a bit shaky to calculate, but this should be the upper bound.
90 const size_t entry_size = sizeof(struct dirent) + PATH_MAX;
91 struct dirent *entry_buf = (struct dirent *) malloc(entry_size);
92
93 while (readdir_r(dp, entry_buf, &de) == 0 && de != NULL) {
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
94 struct stat st;
95 memset(&st, 0, sizeof(st));
96 st.st_ino = de->d_ino;
97 st.st_mode = de->d_type << 12;
7c7bda6 @hzeller o attempt to create a sndfile for every file, if that fails, fall
authored
98 const char *entry_name = de->d_name;
99 if (filler(buf, entry_name, &st, 0))
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
100 break;
101 }
bf030af @hzeller o use readdir_r() - looks like readdir is indeed not really multi-thread
authored
102 free(entry_buf);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
103
104 closedir(dp);
105 return 0;
106 }
107
73093dc @hzeller o Keep open file-descriptor.
authored
108 // readlink(): forward to original filesystem.
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
109 static int folve_readlink(const char *path, char *buf, size_t size) {
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
110 char path_buf[PATH_MAX];
111 const int result = readlink(assemble_orig_path(path_buf, path),
112 buf, size - 1);
113 if (result == -1)
114 return -errno;
115
116 buf[result] = '\0';
117 return 0;
118 }
119
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
120 static int folve_open(const char *path, struct fuse_file_info *fi) {
8b18938 @hzeller o some comment changes. Ready to do some flac handling.
authored
121 // We want to be allowed to only return part of the requested data in read().
122 // That way, we can separate reading the ID3-tags from
123 // decoding of the music stream - that way indexing should be fast.
124 // Setting the flag 'direct_io' allows us to return partial results.
125 fi->direct_io = 1;
126
e9c07dd @hzeller o add documentation
authored
127 // The file-handle has the neat property to be 64 bit - so we can actually
b698853 @hzeller o README updates.
authored
128 // stuff a pointer to our file handler object in there :)
8b18938 @hzeller o some comment changes. Ready to do some flac handling.
authored
129 // (Yay, someone was thinking while developing that API).
08bbf28 @hzeller o First shot at gapless. Works pretty well for my test-case.
authored
130 FileHandler *handler = folve_rt.fs->GetOrCreateHandler(path);
680f590 @hzeller o report opening error.
authored
131 if (handler == NULL)
132 return -errno;
133 fi->fh = (uint64_t) handler;
134 return 0;
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
135 }
136
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
137 static int folve_read(const char *path, char *buf, size_t size, off_t offset,
138 struct fuse_file_info *fi) {
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
139 return reinterpret_cast<FileHandler *>(fi->fh)->Read(buf, size, offset);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
140 }
141
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
142 static int folve_release(const char *path, struct fuse_file_info *fi) {
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
143 folve_rt.fs->Close(path, reinterpret_cast<FileHandler *>(fi->fh));
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
144 return 0;
9a8ea56 @hzeller o add infrastructure to provide Stat() output of currently open
authored
145 }
146
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
147 static int folve_fgetattr(const char *path, struct stat *result,
148 struct fuse_file_info *fi) {
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
149 return reinterpret_cast<FileHandler *>(fi->fh)->Stat(result);
73093dc @hzeller o Keep open file-descriptor.
authored
150 }
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
151
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
152 static void *folve_init(struct fuse_conn_info *conn) {
153 const int ident_len = 20;
154 char *ident = (char*) malloc(ident_len); // openlog() keeps reference. Leaks.
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
155 snprintf(ident, ident_len, "folve[%d]", getpid());
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
156 openlog(ident, LOG_CONS|LOG_PERROR, LOG_USER);
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
157 syslog(LOG_INFO, "Version " FOLVE_VERSION " started. "
158 "Serving '%s' on mount point '%s'",
159 folve_rt.fs->underlying_dir().c_str(), folve_rt.mount_point);
7689c9a @hzeller o preparation to extract classes from folve-filesystem into their
authored
160 if (folve::IsDebugLogEnabled()) {
5830c5a @hzeller o Switch logging to syslog()
authored
161 syslog(LOG_INFO, "Debug logging enabled (-D)");
162 }
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
163
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
164 if (folve_rt.status_port > 0) {
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
165 // Need to start status server after we're daemonized.
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
166 StatusServer *status_server = new StatusServer(folve_rt.fs);
167 if (status_server->Start(folve_rt.status_port)) {
a372a03 @hzeller o Make meta-refresh configurable.
authored
168 syslog(LOG_INFO, "HTTP status server on port %d; refresh=%d",
169 folve_rt.status_port, folve_rt.refresh_time);
170 status_server->set_meta_refresh(folve_rt.refresh_time);
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
171 } else {
172 syslog(LOG_ERR, "Couldn't start HTTP server on port %d\n",
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
173 folve_rt.status_port);
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
174 }
175 }
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
176
177 // Some sanity checks.
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
178 std::set<std::string> available_dirs = folve_rt.fs->GetAvailableConfigDirs();
179 if (available_dirs.empty()) {
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
180 syslog(LOG_NOTICE, "No filter configuration directories given. "
181 "Any files will be just passed through verbatim.");
182 }
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
183 if (available_dirs.size() > 2 && folve_rt.status_port < 0) {
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
184 syslog(LOG_WARNING, "Multiple filter configurations given, but no HTTP "
185 "status port. You only can switch filters via the HTTP interface; "
186 "add -p <port>");
187 }
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
188 return NULL;
189 }
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
190
0a3400d @hzeller o Write when we're exiting.
authored
191 static void folve_destroy(void *) {
db66f7d @hzeller o print which directory is serviced.
authored
192 syslog(LOG_INFO, "Exiting.");
0a3400d @hzeller o Write when we're exiting.
authored
193 }
194
b698853 @hzeller o README updates.
authored
195 static int usage(const char *prg) {
8fb28ec @hzeller Making README.md more readable thanks to wordsmithing input from
authored
196 printf("usage: %s [options] <original-dir> <mount-point-dir>\n", prg);
5830c5a @hzeller o Switch logging to syslog()
authored
197 printf("Options: (in sequence of usefulness)\n"
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
198 "\t-C <cfg-dir> : Convolver base configuration directory.\n"
199 "\t Sub-directories name the different filters.\n"
1971a4a @hzeller o No more radio buttons.
authored
200 "\t Select on the HTTP status page.\n"
5830c5a @hzeller o Switch logging to syslog()
authored
201 "\t-p <port> : Port to run the HTTP status server on.\n"
436f57d @hzeller o Have a default refresh time of 10 seconds.
authored
202 "\t-r <refresh> : Seconds between refresh of status page;\n"
203 "\t Default is %d seconds; switch off with -1.\n"
f9b9bc9 @hzeller o gapless not experimental anymore.
authored
204 "\t-g : Gapless convolving alphabetically adjacent files.\n"
20e139c @hzeller o Less cluttered output in UI if -D is not set.
authored
205 "\t-D : Moderate volume Folve debug messages to syslog,\n"
206 "\t and some more detailed configuration info in UI\n"
5830c5a @hzeller o Switch logging to syslog()
authored
207 "\t-f : Operate in foreground; useful for debugging.\n"
8fb28ec @hzeller Making README.md more readable thanks to wordsmithing input from
authored
208 "\t-o <mnt-opt> : other generic mount parameters passed to FUSE.\n"
209 "\t-d : High volume FUSE debug log. Implies -f.\n",
436f57d @hzeller o Have a default refresh time of 10 seconds.
authored
210 folve_rt.refresh_time);
8b18938 @hzeller o some comment changes. Ready to do some flac handling.
authored
211 return 1;
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
212 }
213
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
214 struct FolveConfig {
215 FolveConfig() : base_dir(NULL), config_dir(NULL), port(-1) {}
216 const char *base_dir;
217 const char *mount_point;
218 const char *config_dir;
219 int port;
220 };
221
222 enum {
223 FOLVE_OPT_PORT = 42,
a372a03 @hzeller o Make meta-refresh configurable.
authored
224 FOLVE_OPT_REFRESH_TIME,
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
225 FOLVE_OPT_CONFIG,
5830c5a @hzeller o Switch logging to syslog()
authored
226 FOLVE_OPT_DEBUG,
08bbf28 @hzeller o First shot at gapless. Works pretty well for my test-case.
authored
227 FOLVE_OPT_GAPLESS,
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
228 };
229
230 int FolveOptionHandling(void *data, const char *arg, int key,
231 struct fuse_args *outargs) {
df18f63 @hzeller o Make path-names to filters and base-directory absolute
authored
232 char realpath_buf[PATH_MAX]; // running as daemon, need absolute names.
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
233 FolveRuntime *rt = (FolveRuntime*) data;
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
234 switch (key) {
235 case FUSE_OPT_KEY_NONOPT:
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
236 // First non-opt: our underlying dir.
237 if (rt->fs->underlying_dir().empty()) {
cf1b0e0 @hzeller o README demo tweaking
authored
238 const char *base_dir = realpath(arg, realpath_buf);
239 if (base_dir != NULL) {
240 rt->fs->set_underlying_dir(base_dir);
241 } else {
242 fprintf(stderr, "Invalid base path '%s': %s\n",
243 arg, strerror(errno));
fa525ee @hzeller o If we find problems in the options, complain and exit.
authored
244 rt->parameter_error = true;
cf1b0e0 @hzeller o README demo tweaking
authored
245 }
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
246 return 0; // we consumed this.
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
247 } else {
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
248 rt->mount_point = strdup(arg); // remmber as FYI
249 return 1; // .. but leave it to fuse
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
250 }
251 case FOLVE_OPT_PORT:
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
252 rt->status_port = atoi(arg + 2); // strip "-p"
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
253 return 0;
a372a03 @hzeller o Make meta-refresh configurable.
authored
254 case FOLVE_OPT_REFRESH_TIME:
255 rt->refresh_time = atoi(arg + 2); // strip "-r"
256 return 0;
cf1b0e0 @hzeller o README demo tweaking
authored
257 case FOLVE_OPT_CONFIG: {
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
258 const char *config_dir = realpath(arg + 2, realpath_buf); // strip "-C"
cf1b0e0 @hzeller o README demo tweaking
authored
259 if (config_dir != NULL) {
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
260 rt->fs->SetBaseConfigDir(config_dir);
cf1b0e0 @hzeller o README demo tweaking
authored
261 } else {
262 fprintf(stderr, "Invalid config dir '%s': %s\n",
263 arg + 2, strerror(errno));
fa525ee @hzeller o If we find problems in the options, complain and exit.
authored
264 rt->parameter_error = true;
cf1b0e0 @hzeller o README demo tweaking
authored
265 }
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
266 return 0;
cf1b0e0 @hzeller o README demo tweaking
authored
267 }
5830c5a @hzeller o Switch logging to syslog()
authored
268 case FOLVE_OPT_DEBUG:
537e34b @hzeller o cleanup UI: no radio buttons anymore, just simple links.
authored
269 // rt->fs->set_debug_ui_enabled(true); // Disabled in status-server.
7689c9a @hzeller o preparation to extract classes from folve-filesystem into their
authored
270 folve::EnableDebugLog(true);
5830c5a @hzeller o Switch logging to syslog()
authored
271 return 0;
08bbf28 @hzeller o First shot at gapless. Works pretty well for my test-case.
authored
272 case FOLVE_OPT_GAPLESS:
273 rt->fs->set_gapless_processing(true);
274 return 0;
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
275 }
276 return 1;
277 }
278
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
279 int main(int argc, char *argv[]) {
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
280 const char *progname = argv[0];
8b18938 @hzeller o some comment changes. Ready to do some flac handling.
authored
281 if (argc < 4) {
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
282 return usage(progname);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
283 }
49eca7f @hzeller o add syslog as preparation for parameter handling.
authored
284
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
285 folve_rt.fs = new FolveFilesystem();
286
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
287 static struct fuse_opt folve_options[] = {
5830c5a @hzeller o Switch logging to syslog()
authored
288 FUSE_OPT_KEY("-p ", FOLVE_OPT_PORT),
a372a03 @hzeller o Make meta-refresh configurable.
authored
289 FUSE_OPT_KEY("-r ", FOLVE_OPT_REFRESH_TIME),
31096bb @hzeller o remove option -c and add -C: give a base directory for all filters.
authored
290 FUSE_OPT_KEY("-C ", FOLVE_OPT_CONFIG),
5830c5a @hzeller o Switch logging to syslog()
authored
291 FUSE_OPT_KEY("-D", FOLVE_OPT_DEBUG),
08bbf28 @hzeller o First shot at gapless. Works pretty well for my test-case.
authored
292 FUSE_OPT_KEY("-g", FOLVE_OPT_GAPLESS),
cca212e @hzeller o document compile error with old version of fuse.
authored
293 FUSE_OPT_END // This fails to compile for fuse <= 2.8.1; get >= 2.8.4
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
294 };
295 struct fuse_args args = FUSE_ARGS_INIT(argc, argv);
ee675fe @hzeller o Provide a way to select between different filter diretories.
authored
296 fuse_opt_parse(&args, &folve_rt, folve_options, FolveOptionHandling);
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
297
fa525ee @hzeller o If we find problems in the options, complain and exit.
authored
298 if (folve_rt.parameter_error || !folve_rt.fs->CheckInitialized()) {
1e9ff21 @hzeller o main: report if parameters are not directories.
authored
299 return usage(progname);
300 }
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
301
302 struct fuse_operations folve_operations;
303 memset(&folve_operations, 0, sizeof(folve_operations));
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
304
0a3400d @hzeller o Write when we're exiting.
authored
305 // Start/stop. Will write to syslog and start auxiliary http service.
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
306 folve_operations.init = folve_init;
0a3400d @hzeller o Write when we're exiting.
authored
307 folve_operations.destroy = folve_destroy;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
308
309 // Basic operations to make navigation work.
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
310 folve_operations.readdir = folve_readdir;
311 folve_operations.readlink = folve_readlink;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
312
313 // open() and close() file.
38cdeb1 @hzeller o whitespace changes.
authored
314 folve_operations.open = folve_open;
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
315 folve_operations.release = folve_release;
8d1fbe7 @hzeller o Move fuse-convolve.c to fuse-convolve.cc. Make filter-interface
authored
316
317 // Actual workhorse: reading a file and returning predicted file-size
0330f76 @hzeller o Only start status server after we're daemonized, otherwise
authored
318 folve_operations.read = folve_read;
319 folve_operations.fgetattr = folve_fgetattr;
320 folve_operations.getattr = folve_getattr;
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
321
27c44cd @hzeller o Use fuse option handling to extract our flags and options.
authored
322 return fuse_main(args.argc, args.argv, &folve_operations, NULL);
98a5725 @hzeller o Start implementation. Just a basic forwarding filesystem for
authored
323 }
Something went wrong with that request. Please try again.