restic: extract Node filesystem code to fs package

This commit is contained in:
Michael Eischer
2024-08-31 17:37:25 +02:00
parent a2e54eac64
commit b9b32e5647
26 changed files with 783 additions and 752 deletions
+41
View File
@@ -0,0 +1,41 @@
package fs
import (
"os"
"syscall"
"github.com/restic/restic/internal/restic"
)
func nodeRestoreSymlinkTimestamps(_ string, _ [2]syscall.Timespec) error {
return nil
}
func (s statT) atim() syscall.Timespec { return s.Atim }
func (s statT) mtim() syscall.Timespec { return s.Mtim }
func (s statT) ctim() syscall.Timespec { return s.Ctim }
// nodeRestoreExtendedAttributes is a no-op on openbsd.
func nodeRestoreExtendedAttributes(_ *restic.Node, _ string) error {
return nil
}
// nodeFillExtendedAttributes is a no-op on openbsd.
func nodeFillExtendedAttributes(_ *restic.Node, _ string, _ bool) error {
return nil
}
// IsListxattrPermissionError is a no-op on openbsd.
func IsListxattrPermissionError(_ error) bool {
return false
}
// nodeRestoreGenericAttributes is no-op on openbsd.
func nodeRestoreGenericAttributes(node *restic.Node, _ string, warn func(msg string)) error {
return restic.HandleAllUnknownGenericAttributesFound(node.GenericAttributes, warn)
}
// fillGenericAttributes is a no-op on openbsd.
func nodeFillGenericAttributes(_ *restic.Node, _ string, _ os.FileInfo, _ *statT) (allowExtended bool, err error) {
return true, nil
}