Refactor for Sync method (#3426)

This commit is contained in:
Rain Li
2022-08-10 23:21:57 +08:00
committed by GitHub
parent 662ec97602
commit 670cb759f8
4 changed files with 69 additions and 7 deletions

View File

@@ -0,0 +1,14 @@
//go:build linux
// +build linux
package backend
import (
"syscall"
)
// Using Fdatasync to optimize file sync operation
func (df *DiskFile) Sync() error {
fd := df.File.Fd()
return syscall.Fdatasync(int(fd))
}