aboutsummaryrefslogtreecommitdiff
path: root/include/fuse.h
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-02 11:30:43 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-02 13:56:40 -0700
commit5698ee09cf7a8495da70659ffae1eaec9f57db27 (patch)
tree798a58a4f49d7f82e3f948463daad4405173483e /include/fuse.h
parentf164e9b8ca319dd1279384ff495b5fa91e778d9e (diff)
Turn struct fuse_chan into an implementation detail
The only struct fuse_chan that's accessible to the user application is the "master" channel that is returned by fuse_mount and stored in struct fuse_session. When using the multi-threaded main loop with the "clone_fd" option, each worker thread gets its own struct fuse_chan. However, none of these are available to the user application, nor do they hold references to struct fuse_session (the pointer is always null). Therefore, any presence of struct fuse_chan can be removed without loss of functionality by relying on struct fuse_session instead. This reduces the number of API functions and removes a potential source of confusion (since the new API no longer looks as if it might be possible to add multiple channels to one session, or to share one channel between multiple sessions). Fixes issue #17.
Diffstat (limited to 'include/fuse.h')
-rw-r--r--include/fuse.h43
1 files changed, 16 insertions, 27 deletions
diff --git a/include/fuse.h b/include/fuse.h
index 948442c..c3fea2d 100644
--- a/include/fuse.h
+++ b/include/fuse.h
@@ -640,55 +640,44 @@ struct fuse_context {
/**
* Create a new FUSE filesystem.
*
- * Known parameters in `args` are removed. If there are any unknown
- * arguments, an error is printed to stderr and the function returns
+ * Known arguments are defined in `struct fuse_opt fuse_lib_opts[]`,
+ * `struct fuse_opt fuse_mount_opts[]`, and `struct fuse_opt
+ * fuse_ll_opts[]`. If there are any unknown arguments, an error
+ * message will be printed to stderr and the function will return
* NULL.
*
* If the --help or --version parameters are specified, the function
* prints the requested information to stdout and returns NULL.
*
- * @param ch the communication channel
* @param args argument vector
* @param op the filesystem operations
* @param op_size the size of the fuse_operations structure
* @param user_data user data supplied in the context during the init() method
* @return the created FUSE handle
*/
-struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
- const struct fuse_operations *op, size_t op_size,
- void *user_data);
+struct fuse *fuse_new(struct fuse_args *args, const struct fuse_operations *op,
+ size_t op_size, void *user_data);
/**
- * Create a FUSE mountpoint
- *
- * Returns a control file descriptor suitable for passing to
- * fuse_new(). Unknown parameters in `args` are passed through
- * unchanged. Known parameters (with the exception of --help and
- * --version) are removed from `args`.
- *
- * If the --help or --version parameters are specified, the function
- * prints the requested information to stdout and returns a valid
- * pointer. However, it does not actually perform the mount.
+ * Mount a FUSE file system.
*
* @param mountpoint the mount point path
- * @param args argument vector
- * @return the communication channel on success, NULL on failure
- */
-struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args);
+ * @param f the FUSE handle
+ *
+ * @return 0 on success, -1 on failure.
+ **/
+int fuse_mount(struct fuse *f, const char *mountpoint);
/**
- * Umount a FUSE mountpoint
+ * Unmount a FUSE file system.
*
- * @param mountpoint the mount point path
- * @param ch the communication channel
- */
-void fuse_unmount(const char *mountpoint, struct fuse_chan *ch);
+ * @param f the FUSE handle
+ **/
+void fuse_unmount(struct fuse *f);
/**
* Destroy the FUSE handle.
*
- * The communication channel attached to the handle is also destroyed.
- *
* NOTE: This function does not unmount the filesystem. If this is
* needed, call fuse_unmount() before calling this function.
*