aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNikolaus Rath <Nikolaus@rath.org>2016-10-15 16:09:16 -0700
committerNikolaus Rath <Nikolaus@rath.org>2016-10-15 16:49:23 -0700
commitd49f2e77b4741706ec125cc62ea913ed5d39bd39 (patch)
treeecdb3d8c7aad836d43844333b87139a105bf1171 /include
parent587df370419e641ed47489f08069ad5f4ca4fe5f (diff)
downloadlibfuse-d49f2e77b4741706ec125cc62ea913ed5d39bd39.tar.gz
Unify handling of fuse_conn_info options
Instead of using command line options to modify struct fuse_conn_info before and after calling the init() handler, we now give the file system explicit control over this.
Diffstat (limited to 'include')
-rw-r--r--include/fuse_common.h55
-rw-r--r--include/fuse_lowlevel.h16
2 files changed, 61 insertions, 10 deletions
diff --git a/include/fuse_common.h b/include/fuse_common.h
index 55f0de2..2a0db73 100644
--- a/include/fuse_common.h
+++ b/include/fuse_common.h
@@ -205,6 +205,61 @@ struct fuse_conn_info {
struct fuse_session;
struct fuse_pollhandle;
+struct fuse_conn_info_opts;
+
+/**
+ * This function parses several command-line options that can be used
+ * to override elements of struct fuse_conn_info. The pointer returned
+ * by this function should be passed to the
+ * fuse_apply_conn_info_opts() method by the file system's init()
+ * handler.
+ *
+ * Before using this function, think twice if you really want these
+ * parameters to be adjustable from the command line. In most cases,
+ * they should be determined by the file system internally.
+ *
+ * The following options are recognized:
+ *
+ * -o max_write=N sets conn->max_write
+ * -o max_readahead=N sets conn->max_readahead
+ * -o max_background=N sets conn->max_background
+ * -o congestion_threshold=N sets conn->congestion_threshold
+ * -o async_read sets FUSE_CAP_ASYNC_READ in conn->want
+ * -o sync_read unsets FUSE_CAP_ASYNC_READ in conn->want
+ * -o atomic_o_trunc sets FUSE_CAP_ATOMIC_O_TRUNC in conn->want
+ * -o no_remote_lock Equivalent to -o no_remote_flock,no_remote_posix_lock
+ * -o no_remote_flock Unsets FUSE_CAP_FLOCK_LOCKS in conn->want
+ * -o no_remote_posix_lock Unsets FUSE_CAP_POSIX_LOCKS in conn->want
+ * -o [no_]splice_write (un-)sets FUSE_CAP_SPLICE_WRITE in conn->want
+ * -o [no_]splice_move (un-)sets FUSE_CAP_SPLICE_MOVE in conn->want
+ * -o [no_]splice_read (un-)sets FUSE_CAP_SPLICE_READ in conn->want
+ * -o [no_]auto_inval_data (un-)sets FUSE_CAP_AUTO_INVAL_DATA in conn->want
+ * -o readdirplus=no unsets FUSE_CAP_READDIRPLUS in conn->want
+ * -o readdirplus=yes sets FUSE_CAP_READDIRPLUS and unsets
+ * FUSE_CAP_READDIRPLUS_AUTO in conn->want
+ * -o readdirplus=auto sets FUSE_CAP_READDIRPLUS and
+ * FUSE_CAP_READDIRPLUS_AUTO in conn->want
+ * -o [no_]async_dio (un-)sets FUSE_CAP_ASYNC_DIO in conn->want
+ * -o [no_]writeback_cache (un-)sets FUSE_CAP_WRITEBACK_CACHE in conn->want
+ * -o time_gran=N sets conn->time_gran
+ *
+ * Known options will be removed from *args*, unknown options will be
+ * passed through unchanged.
+ *
+ * @param args argument vector (input+output)
+ * @return parsed options
+ **/
+struct fuse_conn_info_opts* fuse_parse_conn_info_opts(struct fuse_args *args);
+
+/**
+ * This function applies the (parsed) parameters in *opts* to the
+ * *conn* pointer. It may modify the following fields: wants,
+ * max_write, max_readahead, congestion_threshold, max_background,
+ * time_gran. A field is only set (or unset) if the corresponding
+ * option has been explicitly set.
+ */
+void fuse_apply_conn_info_opts(struct fuse_conn_info_opts *opts,
+ struct fuse_conn_info *conn);
/**
* Go into the background
diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h
index 0b7ee2b..d3aa484 100644
--- a/include/fuse_lowlevel.h
+++ b/include/fuse_lowlevel.h
@@ -1628,18 +1628,11 @@ void fuse_lowlevel_version(void);
void fuse_mount_version(void);
/**
- * Print available low-level options to stdout.
- * These options may be passed to `fuse_session_new()`
- */
-void fuse_lowlevel_help(void);
-
-/**
* Print available mount options to stdout.
* These options may be passed to `fuse_session_new()`
*/
void fuse_mount_help(void);
-
/**
* Print available options for `fuse_parse_cmdline()`.
*/
@@ -1684,9 +1677,12 @@ int fuse_parse_cmdline(struct fuse_args *args,
* Returns a session structure suitable for passing to
* fuse_session_mount() and fuse_session_loop().
*
- * Known options are defined in `struct fuse_opt fuse_ll_opts[]` and
- * `struct fuse_opt fuse_mount_opts[]`. If not all options are known,
- * an error message is written to stderr and the function returns NULL.
+ * Known options can be listed by fuse_mount_help(). Additionally,
+ * this function accepts the `--debug` option (which is not explicitly
+ * listed by fuse_mount_help()).
+ *
+ * If not all options are known, an error message is written to stderr
+ * and the function returns NULL.
*
* @param args argument vector
* @param op the (low-level) filesystem operations