aboutsummaryrefslogtreecommitdiff
path: root/weed/storage/backend/disk_file_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/storage/backend/disk_file_linux.go')
-rw-r--r--weed/storage/backend/disk_file_linux.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/weed/storage/backend/disk_file_linux.go b/weed/storage/backend/disk_file_linux.go
new file mode 100644
index 000000000..a38489dcf
--- /dev/null
+++ b/weed/storage/backend/disk_file_linux.go
@@ -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))
+}