zfs: pipe size: default to value of /proc/sys/fs/pipe-max-siz

Addition by @problame: move getPipeCapacityHint() into platform-specific
code. This has the added benefit of not recognizing the envvar as an
envconst on platform that do not support resizing pipes.  => won't show
up in (zrepl status --raw).Global.Envconst

fixes #424
cloes #449
This commit is contained in:
Lukas Schauer
2021-03-21 21:46:29 +01:00
committed by Christian Schwarz
parent 1e85b1cb5f
commit ee2336a24b
3 changed files with 31 additions and 10 deletions
+5 -1
View File
@@ -7,10 +7,14 @@ import (
"sync"
)
func getPipeCapacityHint(envvar string) int {
return 0 // not supported
}
var zfsPipeCapacityNotSupported sync.Once
func trySetPipeCapacity(p *os.File, capacity int) {
if debugEnabled {
if debugEnabled && capacity != 0 {
zfsPipeCapacityNotSupported.Do(func() {
debug("trySetPipeCapacity error: OS does not support setting pipe capacity")
})