From 3eb5f83db3fecc3827d21d05a7b2a041f165542a Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sat, 6 Jun 2026 22:53:47 +0200 Subject: [PATCH] fs: more vss related unexports --- internal/fs/fs_local_vss.go | 6 +++--- internal/fs/vss.go | 12 ++++++------ internal/fs/vss_windows.go | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/internal/fs/fs_local_vss.go b/internal/fs/fs_local_vss.go index 7808e9f04..1dc5b771c 100644 --- a/internal/fs/fs_local_vss.go +++ b/internal/fs/fs_local_vss.go @@ -44,8 +44,8 @@ type ErrorHandler func(item string, err error) // MessageHandler is used to report errors/messages via callbacks. type MessageHandler func(msg string, args ...interface{}) -// VolumeFilter is used to filter volumes by their mount point or GUID path. -type VolumeFilter func(volume string) bool +// volumeFilter is used to filter volumes by their mount point or GUID path. +type volumeFilter func(volume string) bool // LocalVss is a wrapper around the local file system which uses windows volume // shadow copy service (VSS) in a transparent way. @@ -185,7 +185,7 @@ func (fs *LocalVss) snapshotPath(path string) string { } else { fs.msgMessage("creating VSS snapshot for [%s]\n", vssVolume) - var includeVolume VolumeFilter + var includeVolume volumeFilter if !fs.excludeAllMountPoints { includeVolume = func(volume string) bool { return fs.isMountPointIncluded(volume) diff --git a/internal/fs/vss.go b/internal/fs/vss.go index 8e0eced1e..4ceab5624 100644 --- a/internal/fs/vss.go +++ b/internal/fs/vss.go @@ -8,23 +8,23 @@ import ( "github.com/restic/restic/internal/errors" ) -// MountPoint is a dummy for non-windows platforms to let client code compile. -type MountPoint struct { +// mountPoint is a dummy for non-windows platforms to let client code compile. +type mountPoint struct { } // IsSnapshotted is true if this mount point was snapshotted successfully. -func (p *MountPoint) IsSnapshotted() bool { +func (p *mountPoint) IsSnapshotted() bool { return false } // GetSnapshotDeviceObject returns root path to access the snapshot files and folders. -func (p *MountPoint) GetSnapshotDeviceObject() string { +func (p *mountPoint) GetSnapshotDeviceObject() string { return "" } // vssSnapshot is a dummy for non-windows platforms to let client code compile. type vssSnapshot struct { - mountPointInfo map[string]MountPoint + mountPointInfo map[string]mountPoint } // HasSufficientPrivilegesForVSS returns nil if the user is allowed to use VSS. @@ -41,7 +41,7 @@ func getVolumeNameForVolumeMountPoint(mountPoint string) (string, error) { // newVssSnapshot creates a new vss snapshot. If creating the snapshots doesn't // finish within the timeout an error is returned. func newVssSnapshot(_ string, - _ string, _ time.Duration, _ VolumeFilter, _ ErrorHandler) (vssSnapshot, error) { + _ string, _ time.Duration, _ volumeFilter, _ ErrorHandler) (vssSnapshot, error) { return vssSnapshot{}, errors.New("VSS snapshots are only supported on windows") } diff --git a/internal/fs/vss_windows.go b/internal/fs/vss_windows.go index 3491a1fe7..01ca86774 100644 --- a/internal/fs/vss_windows.go +++ b/internal/fs/vss_windows.go @@ -886,7 +886,7 @@ func getVolumeNameForVolumeMountPoint(mountPoint string) (string, error) { // newVssSnapshot creates a new vss snapshot. If creating the snapshots doesn't // finish within the timeout an error is returned. func newVssSnapshot(provider string, - volume string, timeout time.Duration, filter VolumeFilter, msgError ErrorHandler) (vssSnapshot, error) { + volume string, timeout time.Duration, filter volumeFilter, msgError ErrorHandler) (vssSnapshot, error) { is64Bit, err := isRunningOn64BitWindows() if err != nil { return vssSnapshot{}, newVssTextError(fmt.Sprintf(