diff options
| author | Alan Somers <asomers@FreeBSD.org> | 2019-06-21 04:57:23 +0000 |
|---|---|---|
| committer | Alan Somers <asomers@FreeBSD.org> | 2019-06-21 04:57:23 +0000 |
| commit | 87ff949a7b5ab631b7e557543e05df69279ac3a3 (patch) | |
| tree | b1cc99d637c81063448cdfaf6894c890f7863bc3 /tests | |
| parent | 1f309e37f539ae4dd3cf7c0fec09d9e2c486da04 (diff) | |
Notes
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/sys/fs/fusefs/mockfs.cc | 10 | ||||
| -rw-r--r-- | tests/sys/fs/fusefs/mockfs.hh | 12 |
2 files changed, 19 insertions, 3 deletions
diff --git a/tests/sys/fs/fusefs/mockfs.cc b/tests/sys/fs/fusefs/mockfs.cc index d0dc5c1ef095f..0584b43db4826 100644 --- a/tests/sys/fs/fusefs/mockfs.cc +++ b/tests/sys/fs/fusefs/mockfs.cc @@ -469,11 +469,15 @@ void MockFS::init(uint32_t flags) { out->body.init.major = FUSE_KERNEL_VERSION; out->body.init.minor = m_kernel_minor_version;; out->body.init.flags = in->body.init.flags & flags; - out->body.init.max_write = m_maxwrite; - out->body.init.max_readahead = m_maxreadahead; - SET_OUT_HEADER_LEN(*out, init); + + if (m_kernel_minor_version < 23) { + SET_OUT_HEADER_LEN(*out, init_7_22); + } else { + SET_OUT_HEADER_LEN(*out, init); + } + write(m_fuse_fd, out.get(), out->header.len); } diff --git a/tests/sys/fs/fusefs/mockfs.hh b/tests/sys/fs/fusefs/mockfs.hh index 174ed4c329ab6..e8bd09df1c8dd 100644 --- a/tests/sys/fs/fusefs/mockfs.hh +++ b/tests/sys/fs/fusefs/mockfs.hh @@ -122,6 +122,17 @@ struct fuse_create_out_7_8 { struct fuse_open_out open; }; +/* Output struct for FUSE_INIT for protocol 7.22 and earlier servers */ +struct fuse_init_out_7_22 { + uint32_t major; + uint32_t minor; + uint32_t max_readahead; + uint32_t flags; + uint16_t max_background; + uint16_t congestion_threshold; + uint32_t max_write; +}; + union fuse_payloads_in { fuse_access_in access; fuse_bmap_in bmap; @@ -178,6 +189,7 @@ union fuse_payloads_out { fuse_lk_out getlk; fuse_getxattr_out getxattr; fuse_init_out init; + fuse_init_out_7_22 init_7_22; /* The inval_entry structure should be followed by the entry's name */ fuse_notify_inval_entry_out inval_entry; fuse_notify_inval_inode_out inval_inode; |
