Add direct io option for file operations
parent
bf33916294
commit
025868ecf2
|
@ -561,6 +561,10 @@ func (c *Connection) kernelResponseForOp(
|
||||||
out.OpenFlags |= uint32(fusekernel.OpenKeepCache)
|
out.OpenFlags |= uint32(fusekernel.OpenKeepCache)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if o.UseDirectIO {
|
||||||
|
out.OpenFlags |= uint32(fusekernel.OpenDirectIO)
|
||||||
|
}
|
||||||
|
|
||||||
case *fuseops.ReadFileOp:
|
case *fuseops.ReadFileOp:
|
||||||
// convertInMessage already set up the destination buffer to be at the end
|
// convertInMessage already set up the destination buffer to be at the end
|
||||||
// of the out message. We need only shrink to the right size based on how
|
// of the out message. We need only shrink to the right size based on how
|
||||||
|
|
|
@ -564,6 +564,15 @@ type OpenFileOp struct {
|
||||||
// is set to true, regardless of its value, at least for files opened in the
|
// is set to true, regardless of its value, at least for files opened in the
|
||||||
// same mode. (Cf. https://github.com/osxfuse/osxfuse/issues/223)
|
// same mode. (Cf. https://github.com/osxfuse/osxfuse/issues/223)
|
||||||
KeepPageCache bool
|
KeepPageCache bool
|
||||||
|
|
||||||
|
// Whether to use direct IO for this file handle. By default, the kernel
|
||||||
|
// suppresses what it sees as redundant operations (including reads beyond
|
||||||
|
// the precomputed EOF).
|
||||||
|
//
|
||||||
|
// Enabling direct IO ensures that all client operations reach the fuse
|
||||||
|
// layer. This allows for filesystems whose file sizes are not known in
|
||||||
|
// advance, for example, because contents are generated on the fly.
|
||||||
|
UseDirectIO bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read data from a file previously opened with CreateFile or OpenFile.
|
// Read data from a file previously opened with CreateFile or OpenFile.
|
||||||
|
|
Loading…
Reference in New Issue