mirror of
https://github.com/containers/skopeo.git
synced 2025-09-27 05:03:41 +00:00
Bump github.com/containers/storage from 1.41.0 to 1.42.0
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.41.0 to 1.42.0. - [Release notes](https://github.com/containers/storage/releases) - [Changelog](https://github.com/containers/storage/blob/main/docs/containers-storage-changes.md) - [Commits](https://github.com/containers/storage/compare/v1.41.0...v1.42.0) --- updated-dependencies: - dependency-name: github.com/containers/storage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
24
vendor/github.com/containers/storage/drivers/driver_linux.go
generated
vendored
24
vendor/github.com/containers/storage/drivers/driver_linux.go
generated
vendored
@@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package graphdriver
|
||||
@@ -162,11 +163,32 @@ func (c *defaultChecker) IsMounted(path string) bool {
|
||||
return m
|
||||
}
|
||||
|
||||
// isMountPoint checks that the given path is a mount point
|
||||
func isMountPoint(mountPath string) (bool, error) {
|
||||
// it is already the root
|
||||
if mountPath == "/" {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
var s1, s2 unix.Stat_t
|
||||
if err := unix.Stat(mountPath, &s1); err != nil {
|
||||
return true, err
|
||||
}
|
||||
if err := unix.Stat(filepath.Dir(mountPath), &s2); err != nil {
|
||||
return true, err
|
||||
}
|
||||
return s1.Dev != s2.Dev, nil
|
||||
}
|
||||
|
||||
// Mounted checks if the given path is mounted as the fs type
|
||||
func Mounted(fsType FsMagic, mountPath string) (bool, error) {
|
||||
var buf unix.Statfs_t
|
||||
|
||||
if err := unix.Statfs(mountPath, &buf); err != nil {
|
||||
return false, err
|
||||
}
|
||||
return FsMagic(buf.Type) == fsType, nil
|
||||
if FsMagic(buf.Type) != fsType {
|
||||
return false, nil
|
||||
}
|
||||
return isMountPoint(mountPath)
|
||||
}
|
||||
|
Reference in New Issue
Block a user