mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 08:23:34 +01:00
d231cefe25
This is a follow-up for 43b24164ef
* lib/fs: adds memory map for windows
it should improve performance for file reading
* lib/storage: replace '/' with os specific separator
it must fix an errors for windows
* lib/fs: mention windows fsync support
* lib/filestream: adds fdatasync for windows writes
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/70
21 lines
361 B
Go
21 lines
361 B
Go
package filestream
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"golang.org/x/sys/windows"
|
|
)
|
|
|
|
func (st *streamTracker) adviseDontNeed(n int, fdatasync bool) error {
|
|
if fdatasync && st.fd > 0 {
|
|
if err := windows.Fsync(windows.Handle(st.fd)); err != nil {
|
|
return fmt.Errorf("windows.Fsync error: %w", err)
|
|
}
|
|
}
|
|
return nil
|
|
}
|
|
|
|
func (st *streamTracker) close() error {
|
|
return nil
|
|
}
|