MCPcopy
hub / github.com/lxc/incus / SyncFS

Function SyncFS

internal/linux/filesystem.go:151–162  ·  view source on GitHub ↗

SyncFS will force a filesystem sync for the filesystem backing the provided path.

(path string)

Source from the content-addressed store, hash-verified

149
150// SyncFS will force a filesystem sync for the filesystem backing the provided path.
151func SyncFS(path string) error {
152 // Get us a file descriptor.
153 fsFile, err := os.Open(path)
154 if err != nil {
155 return err
156 }
157
158 defer logger.WarnOnError(fsFile.Close, "Failed to close file")
159
160 // Call SyncFS.
161 return unix.Syncfs(int(fsFile.Fd()))
162}
163
164// PathNameEncode encodes a path string to be used as part of a file name.
165// The encoding scheme replaces "-" with "--" and then "/" with "-".

Callers 8

RefreshInstanceMethod · 0.92
MigrateInstanceMethod · 0.92
filesystemFreezeMethod · 0.92
UnmountVolumeMethod · 0.92
CreateVolumeSnapshotMethod · 0.92
UnmountVolumeSnapshotMethod · 0.92

Calls 2

WarnOnErrorFunction · 0.92
OpenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…