diff options
author | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-27 21:38:42 -0700 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2016-10-27 21:38:42 -0700 |
commit | e885e84f796da2433907e57358bc4916bca30a50 (patch) | |
tree | 278350db190c3f8f50933397d368cc9fbbbe74e9 /lib/fuse_lowlevel.c | |
parent | 4fade0c616a9227e42043ac3332f0fc59a6df327 (diff) |
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.
Diffstat (limited to 'lib/fuse_lowlevel.c')
-rw-r--r-- | lib/fuse_lowlevel.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 45e9d32..8455669 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -1916,6 +1916,14 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) if (se->op.init) se->op.init(se->userdata, &se->conn); + unsigned max_read_mo = get_max_read(se->mo); + if (se->conn.max_read != max_read_mo) { + fprintf(stderr, "fuse: error: init() and fuse_session_new() " + "requested different maximum read size (%u vs %u)\n", + se->conn.max_read, max_read_mo); + abort(); + } + /* Always enable big writes, this is superseded by the max_write option */ outarg.flags |= FUSE_BIG_WRITES; |