Refactor for Sync method (#3426)
This commit is contained in:
14
weed/storage/backend/disk_file_linux.go
Normal file
14
weed/storage/backend/disk_file_linux.go
Normal 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))
|
||||
}
|
||||
Reference in New Issue
Block a user