Skip to content

Commit bf692d4

Browse files
committed
deprecate pkg/loopback (utility package for devicemapper)
This package was introduced in af59752 as a utility package for devicemapper, which was removed in commit dc11d2a (v25.0.0). It looks like there's no external consumers of this package, so we should consider removing it, but deprecating it first, just in case. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent a1833d8 commit bf692d4

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

pkg/loopback/attach_loopback.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
8888

8989
// AttachLoopDevice attaches the given sparse file to the next
9090
// available loopback device. It returns an opened *os.File.
91+
//
92+
// Deprecated: the loopback package is deprected and will be removed in the next release.
9193
func AttachLoopDevice(sparseName string) (loop *os.File, err error) {
9294
// Try to retrieve the next available loopback device via syscall.
9395
// If it fails, we discard error and start looping for a

pkg/loopback/loopback.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
//go:build linux && cgo
22

3+
// Package loopback provides utilities to work with loopback devices.
4+
//
5+
// Deprecated: this package is deprecated and will be removed in the next release.
6+
37
package loopback // import "github.com/docker/docker/pkg/loopback"
48

59
import (
@@ -21,6 +25,8 @@ func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
2125
}
2226

2327
// SetCapacity reloads the size for the loopback device.
28+
//
29+
// Deprecated: the loopback package is deprected and will be removed in the next release.
2430
func SetCapacity(file *os.File) error {
2531
if err := unix.IoctlSetInt(int(file.Fd()), unix.LOOP_SET_CAPACITY, 0); err != nil {
2632
log.G(context.TODO()).Errorf("Error loopbackSetCapacity: %s", err)
@@ -31,6 +37,8 @@ func SetCapacity(file *os.File) error {
3137

3238
// FindLoopDeviceFor returns a loopback device file for the specified file which
3339
// is backing file of a loop back device.
40+
//
41+
// Deprecated: the loopback package is deprected and will be removed in the next release.
3442
func FindLoopDeviceFor(file *os.File) *os.File {
3543
var stat unix.Stat_t
3644
err := unix.Stat(file.Name(), &stat)

0 commit comments

Comments
 (0)