From e885e84f796da2433907e57358bc4916bca30a50 Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Thu, 27 Oct 2016 21:38:42 -0700 Subject: Add max_read to fuse_conn_info Eventually, this setting should be negotiated in the filesystem's init() handler (like e.g. max_write). However, this requires corresponding changes in the FUSE kernel module. In preparation for this (and to allow a transition period) we already allow (and require) filesystems to set the value in the init() handler in addition to the mount option. The end-goal is tracked in issue #91. --- lib/mount_bsd.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/mount_bsd.c') diff --git a/lib/mount_bsd.c b/lib/mount_bsd.c index 9cf9dfa..8bff2cf 100644 --- a/lib/mount_bsd.c +++ b/lib/mount_bsd.c @@ -40,6 +40,7 @@ struct mount_opts { int allow_other; int allow_root; char *kernel_opts; + unsigned max_read; }; #define FUSE_DUAL_OPT_KEY(templ, key) \ @@ -48,6 +49,7 @@ struct mount_opts { static const struct fuse_opt fuse_mount_opts[] = { { "allow_other", offsetof(struct mount_opts, allow_other), 1 }, { "allow_root", offsetof(struct mount_opts, allow_root), 1 }, + { "max_read=%u", offsetof(struct mount_opts, max_read), 1 }, FUSE_OPT_KEY("allow_root", KEY_ALLOW_ROOT), FUSE_OPT_KEY("-r", KEY_RO), /* standard FreeBSD mount options */ @@ -98,6 +100,11 @@ void fuse_mount_version(void) system(FUSERMOUNT_PROG " --version"); } +unsigned get_max_read(struct mount_opts *o) +{ + return o->max_read; +} + static int fuse_mount_opt_proc(void *data, const char *arg, int key, struct fuse_args *outargs) { -- cgit v1.2.3