Compare commits
1 Commits
master
...
geesefs-0-
Author | SHA1 | Date |
---|---|---|
Vitaliy Filippov | 003d54287c |
|
@ -485,8 +485,15 @@ func (c *Connection) Reply(ctx context.Context, opErr error) {
|
||||||
outMsg := state.outMsg
|
outMsg := state.outMsg
|
||||||
fuseID := inMsg.Header().Unique
|
fuseID := inMsg.Header().Unique
|
||||||
|
|
||||||
|
suppressReuse := false
|
||||||
|
if wr, ok := op.(*fuseops.WriteFileOp); ok {
|
||||||
|
suppressReuse = wr.SuppressReuse
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure we destroy the messages when we're done.
|
// Make sure we destroy the messages when we're done.
|
||||||
|
if !suppressReuse {
|
||||||
defer c.putInMessage(inMsg)
|
defer c.putInMessage(inMsg)
|
||||||
|
}
|
||||||
defer c.putOutMessage(outMsg)
|
defer c.putOutMessage(outMsg)
|
||||||
|
|
||||||
// Clean up state for this op.
|
// Clean up state for this op.
|
||||||
|
|
|
@ -719,6 +719,17 @@ type WriteFileOp struct {
|
||||||
// because it uses file mmapping machinery (http://goo.gl/SGxnaN) to write a
|
// because it uses file mmapping machinery (http://goo.gl/SGxnaN) to write a
|
||||||
// page at a time.
|
// page at a time.
|
||||||
Data []byte
|
Data []byte
|
||||||
|
|
||||||
|
// Set by the file system: "no reuse" flag.
|
||||||
|
//
|
||||||
|
// By default, the Data buffer is reused by the library, so the file system
|
||||||
|
// must copy the data if it wants to use it later.
|
||||||
|
//
|
||||||
|
// However, if the file system sets this flag to true, the library doesn't
|
||||||
|
// reuse this buffer, so the file system can safely store and use Data slice
|
||||||
|
// without copying memory.
|
||||||
|
SuppressReuse bool
|
||||||
|
|
||||||
OpContext OpContext
|
OpContext OpContext
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,4 +17,4 @@ package buffer
|
||||||
// The maximum fuse write request size that InMessage can acommodate.
|
// The maximum fuse write request size that InMessage can acommodate.
|
||||||
//
|
//
|
||||||
// As of kernel 4.20 Linux accepts writes up to 256 pages or 1MiB
|
// As of kernel 4.20 Linux accepts writes up to 256 pages or 1MiB
|
||||||
const MaxWriteSize = 1 << 20
|
const MaxWriteSize = 1 << 17
|
||||||
|
|
Loading…
Reference in New Issue