mirror of
https://github.com/containers/podman.git
synced 2025-12-11 01:11:30 +08:00
vendor in latest containers/(storage,common,image)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
29
vendor/github.com/containers/storage/drivers/driver_freebsd.go
generated
vendored
29
vendor/github.com/containers/storage/drivers/driver_freebsd.go
generated
vendored
@@ -1,16 +1,45 @@
|
||||
package graphdriver
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"golang.org/x/sys/unix"
|
||||
|
||||
"github.com/containers/storage/pkg/mount"
|
||||
)
|
||||
|
||||
const (
|
||||
// FsMagicZfs filesystem id for Zfs
|
||||
FsMagicZfs = FsMagic(0x2fc12fc1)
|
||||
)
|
||||
|
||||
var (
|
||||
// Slice of drivers that should be used in an order
|
||||
priority = []string{
|
||||
"zfs",
|
||||
"vfs",
|
||||
}
|
||||
|
||||
// FsNames maps filesystem id to name of the filesystem.
|
||||
FsNames = map[FsMagic]string{
|
||||
FsMagicZfs: "zfs",
|
||||
}
|
||||
)
|
||||
|
||||
// NewDefaultChecker returns a check that parses /proc/mountinfo to check
|
||||
// if the specified path is mounted.
|
||||
// No-op on FreeBSD.
|
||||
func NewDefaultChecker() Checker {
|
||||
return &defaultChecker{}
|
||||
}
|
||||
|
||||
type defaultChecker struct {
|
||||
}
|
||||
|
||||
func (c *defaultChecker) IsMounted(path string) bool {
|
||||
m, _ := mount.Mounted(path)
|
||||
return m
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
2
vendor/github.com/containers/storage/drivers/register/register_zfs.go
generated
vendored
2
vendor/github.com/containers/storage/drivers/register/register_zfs.go
generated
vendored
@@ -1,4 +1,4 @@
|
||||
// +build !exclude_graphdriver_zfs,linux !exclude_graphdriver_zfs,freebsd, solaris
|
||||
// +build !exclude_graphdriver_zfs,linux !exclude_graphdriver_zfs,freebsd solaris
|
||||
|
||||
package register
|
||||
|
||||
|
||||
4
vendor/github.com/containers/storage/drivers/zfs/zfs.go
generated
vendored
4
vendor/github.com/containers/storage/drivers/zfs/zfs.go
generated
vendored
@@ -344,7 +344,7 @@ func (d *Driver) create(id, parent string, opts *graphdriver.CreateOpts) error {
|
||||
return errors.Wrap(err, "error creating zfs mount")
|
||||
}
|
||||
defer func() {
|
||||
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
||||
if err := detachUnmount(mountpoint); err != nil {
|
||||
logrus.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
|
||||
}
|
||||
}()
|
||||
@@ -483,7 +483,7 @@ func (d *Driver) Put(id string) error {
|
||||
|
||||
logger.Debugf(`unmount("%s")`, mountpoint)
|
||||
|
||||
if err := unix.Unmount(mountpoint, unix.MNT_DETACH); err != nil {
|
||||
if err := detachUnmount(mountpoint); err != nil {
|
||||
logger.Warnf("Failed to unmount %s mount %s: %v", id, mountpoint, err)
|
||||
}
|
||||
if err := unix.Rmdir(mountpoint); err != nil && !os.IsNotExist(err) {
|
||||
|
||||
5
vendor/github.com/containers/storage/drivers/zfs/zfs_freebsd.go
generated
vendored
5
vendor/github.com/containers/storage/drivers/zfs/zfs_freebsd.go
generated
vendored
@@ -37,3 +37,8 @@ func getMountpoint(id string) string {
|
||||
|
||||
return id[:maxlen]
|
||||
}
|
||||
|
||||
func detachUnmount(mountpoint string) error {
|
||||
// FreeBSD doesn't have an equivalent to MNT_DETACH
|
||||
return unix.Unmount(mountpoint, 0)
|
||||
}
|
||||
|
||||
5
vendor/github.com/containers/storage/drivers/zfs/zfs_linux.go
generated
vendored
5
vendor/github.com/containers/storage/drivers/zfs/zfs_linux.go
generated
vendored
@@ -4,6 +4,7 @@ import (
|
||||
graphdriver "github.com/containers/storage/drivers"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/sirupsen/logrus"
|
||||
"golang.org/x/sys/unix"
|
||||
)
|
||||
|
||||
func checkRootdirFs(rootDir string) error {
|
||||
@@ -27,3 +28,7 @@ func checkRootdirFs(rootDir string) error {
|
||||
func getMountpoint(id string) string {
|
||||
return id
|
||||
}
|
||||
|
||||
func detachUnmount(mountpoint string) error {
|
||||
return unix.Unmount(mountpoint, unix.MNT_DETACH)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user