MCPcopy
hub / github.com/containerd/containerd / AttachLoopDevice

Function AttachLoopDevice

core/mount/losetup_linux.go:229–236  ·  view source on GitHub ↗

AttachLoopDevice attaches a specified backing file to a loop device

(backingFile string)

Source from the content-addressed store, hash-verified

227
228// AttachLoopDevice attaches a specified backing file to a loop device
229func AttachLoopDevice(backingFile string) (string, error) {
230 file, err := SetupLoop(backingFile, LoopParams{})
231 if err != nil {
232 return "", err
233 }
234 defer file.Close()
235 return file.Name(), nil
236}
237
238// DetachLoopDevice detaches the provided loop devices
239func DetachLoopDevice(devices ...string) error {

Callers 4

createLoopbackDeviceFunction · 0.92
createLoopbackDeviceFunction · 0.92
createLoopbackDeviceFunction · 0.92

Calls 3

SetupLoopFunction · 0.85
CloseMethod · 0.65
NameMethod · 0.65

Tested by 4

createLoopbackDeviceFunction · 0.74
createLoopbackDeviceFunction · 0.74
createLoopbackDeviceFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…