Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,13 @@ func (c *Connection) Init() error {

// kernel 4.20 increases the max from 32 -> 256
initOp.Flags |= fusekernel.InitMaxPages
initOp.MaxPages = 256

// MaxPages is the maximum size, in hardware pages, of the FUSE message
// payload. It applies to both requests and replies, and does not include
// the extra 1 page for the FUSE header and the "args" struct. We set it to
// the max of our message in/out payload sizes.
maxPayload := max(buffer.MaxReadSize, buffer.MaxWriteSize)
initOp.MaxPages = uint16(maxPayload / buffer.GetPageSize())

// Enable writeback caching if the user hasn't asked us not to.
if !c.cfg.DisableWritebackCaching {
Expand Down
6 changes: 6 additions & 0 deletions internal/buffer/in_message.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ func init() {
bufSize = pageSize + MaxWriteSize
}

// Return the hardware page size. Note that this is not always 4KiB! Notably
// it's larger (e.g. 64KiB) on some ARM64 architectures.
func GetPageSize() int {
return pageSize
}

// An incoming message from the kernel, including leading fusekernel.InHeader
// struct. Provides storage for messages and convenient access to their
// contents.
Expand Down