summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorStefan Siegl <stesie@brokenpipe.de>2006-08-04 00:39:36 +0000
committerStefan Siegl <stesie@brokenpipe.de>2006-08-04 00:39:36 +0000
commitea03092a6c07eaeeb456a1ed845ebf62d81ec314 (patch)
tree89114a56df4fe9d14f1777eb468bb8bf8608a97d /src/main.c
parentf7f3136a35212fa7a346bf65867639bfbfd5eaec (diff)
added support for fuse contexts, including fuse_get_context function
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index ed61db41e..cbb54832f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,9 +39,8 @@ const struct fuse_operations_compat2 *fuse_ops_compat2 = NULL;
/* the port where to write out debug messages to, NULL to omit these */
FILE *debug_port = NULL;
-/* magic number, passed from fuse_mount to fuse_new */
-#define FUSE_MAGIC ((int) 0x66757365)
-
+/* the private data pointer returned from init() callback */
+void *fsys_privdata = NULL;
/* Interpret a __single__ mount option
@@ -322,6 +321,9 @@ fuse_new_compat22(int fd, const char *opts,
fuse_ops_compat22 = op;
+ if(op->init)
+ fsys_privdata = op->init();
+
return (void *) FUSE_MAGIC; /* we don't have a fuse structure, sorry. */
}
@@ -529,3 +531,11 @@ fuse_exited(struct fuse *f)
*/
return 0;
}
+
+
+struct fuse_context *
+fuse_get_context(void)
+{
+ struct fuse_context *ctx = cthread_data(cthread_self());
+ return ctx;
+}