MCPcopy
hub / github.com/lxc/incus / IsBlockdevPath

Function IsBlockdevPath

internal/linux/filesystem.go:268–276  ·  view source on GitHub ↗

IsBlockdevPath checks if the provided path is a block device.

(pathName string)

Source from the content-addressed store, hash-verified

266
267// IsBlockdevPath checks if the provided path is a block device.
268func IsBlockdevPath(pathName string) bool {
269 sb, err := os.Stat(pathName)
270 if err != nil {
271 return false
272 }
273
274 fm := sb.Mode()
275 return ((fm&os.ModeDevice != 0) && (fm&os.ModeCharDevice == 0))
276}
277
278// GetMountinfo tracks down the mount entry for the path and returns all MountInfo fields.
279func GetMountinfo(path string) ([]string, error) {

Callers 15

ImageUnpackFunction · 0.92
CreateMethod · 0.92
MountMethod · 0.92
enlargeVolumeBlockFileFunction · 0.92
BlockDiskSizeBytesFunction · 0.92
BackupVolumeFunction · 0.92
moveGPTAltHeaderMethod · 0.92
CreateMethod · 0.92
DeleteMethod · 0.92
MountMethod · 0.92
FillConfigMethod · 0.92
openLoopFileMethod · 0.92

Calls 1

ModeMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…