Commit 9334ba57 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Actually inspect canSplice setting.

parent 3d0a4381
......@@ -9,16 +9,19 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status {
}
if req.fdData != nil {
if err := ms.trySplice(header, req, req.fdData); err == nil {
req.readResult.Done()
return OK
} else {
if ms.canSplice {
err := ms.trySplice(header, req, req.fdData)
if err == nil {
req.readResult.Done()
return OK
}
log.Println("trySplice:", err)
sz := req.flatDataSize()
buf := ms.AllocOut(req, uint32(sz))
req.flatData, req.status = req.fdData.Bytes(buf)
header = req.serializeHeader(len(req.flatData))
}
sz := req.flatDataSize()
buf := ms.AllocOut(req, uint32(sz))
req.flatData, req.status = req.fdData.Bytes(buf)
header = req.serializeHeader(len(req.flatData))
}
_, err := Writev(int(ms.mountFile.Fd()), [][]byte{header, req.flatData})
......
......@@ -116,7 +116,7 @@ func (r *request) OutputDebug() string {
} else {
spl := ""
if r.fdData != nil {
spl = " (splice)"
spl = " (fd data)"
}
flatStr = fmt.Sprintf(" %d bytes data%s\n", r.flatDataSize(), spl)
}
......
......@@ -32,8 +32,9 @@ func init() {
content, err := ioutil.ReadFile("/proc/sys/fs/pipe-max-size")
if err != nil {
maxPipeSize = DefaultPipeSize
} else {
fmt.Sscan(string(content), &maxPipeSize)
}
fmt.Sscan(string(content), &maxPipeSize)
r, w, err := os.Pipe()
if err != nil {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment