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.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/mount.c') diff --git a/lib/mount.c b/lib/mount.c index 051b424..bb13c30 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -73,6 +73,7 @@ struct mount_opts { char *mtab_opts; char *fusermount_opts; char *kernel_opts; + unsigned max_read; }; #define FUSE_MOUNT_OPT(t, p) { t, offsetof(struct mount_opts, p), 1 } @@ -83,6 +84,7 @@ static const struct fuse_opt fuse_mount_opts[] = { FUSE_MOUNT_OPT("blkdev", blkdev), FUSE_MOUNT_OPT("auto_unmount", auto_unmount), FUSE_MOUNT_OPT("fsname=%s", fsname), + FUSE_MOUNT_OPT("max_read=%u", max_read), FUSE_MOUNT_OPT("subtype=%s", subtype), FUSE_OPT_KEY("allow_other", KEY_KERN_OPT), FUSE_OPT_KEY("allow_root", KEY_ALLOW_ROOT), @@ -157,6 +159,11 @@ static const struct mount_flags mount_flags[] = { {NULL, 0, 0} }; +unsigned get_max_read(struct mount_opts *o) +{ + return o->max_read; +} + static void set_mount_flag(const char *s, int *flags) { int i; -- cgit v1.2.3