Ver código fonte

Merge pull request #46506 from thaJeztah/deprecate_pkg_loopback

deprecate pkg/loopback (utility package for devicemapper)
Bjorn Neergaard 1 ano atrás
pai
commit
05c60724ed
2 arquivos alterados com 10 adições e 0 exclusões
  1. 2 0
      pkg/loopback/attach_loopback.go
  2. 8 0
      pkg/loopback/loopback.go

+ 2 - 0
pkg/loopback/attach_loopback.go

@@ -88,6 +88,8 @@ func openNextAvailableLoopback(index int, sparseFile *os.File) (loopFile *os.Fil
 
 // AttachLoopDevice attaches the given sparse file to the next
 // available loopback device. It returns an opened *os.File.
+//
+// Deprecated: the loopback package is deprected and will be removed in the next release.
 func AttachLoopDevice(sparseName string) (loop *os.File, err error) {
 	// Try to retrieve the next available loopback device via syscall.
 	// If it fails, we discard error and start looping for a

+ 8 - 0
pkg/loopback/loopback.go

@@ -1,5 +1,9 @@
 //go:build linux && cgo
 
+// Package loopback provides utilities to work with loopback devices.
+//
+// Deprecated: this package is deprecated and will be removed in the next release.
+
 package loopback // import "github.com/docker/docker/pkg/loopback"
 
 import (
@@ -21,6 +25,8 @@ func getLoopbackBackingFile(file *os.File) (uint64, uint64, error) {
 }
 
 // SetCapacity reloads the size for the loopback device.
+//
+// Deprecated: the loopback package is deprected and will be removed in the next release.
 func SetCapacity(file *os.File) error {
 	if err := unix.IoctlSetInt(int(file.Fd()), unix.LOOP_SET_CAPACITY, 0); err != nil {
 		log.G(context.TODO()).Errorf("Error loopbackSetCapacity: %s", err)
@@ -31,6 +37,8 @@ func SetCapacity(file *os.File) error {
 
 // FindLoopDeviceFor returns a loopback device file for the specified file which
 // is backing file of a loop back device.
+//
+// Deprecated: the loopback package is deprected and will be removed in the next release.
 func FindLoopDeviceFor(file *os.File) *os.File {
 	var stat unix.Stat_t
 	err := unix.Stat(file.Name(), &stat)