diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-08-23 14:01:20 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-23 14:01:20 -0400 |
commit | 90cf78b199772082025f22e4ebc0e30c133d2a88 (patch) | |
tree | e890e717d5b5ce7bc51821776607464a7759271d /libpod | |
parent | 6a3741598cc30216a1a8db7d2c917e19bc37002b (diff) | |
parent | edddfe8c4f7761b12dc64ea4aa0a83b755aa124f (diff) | |
download | podman-90cf78b199772082025f22e4ebc0e30c133d2a88.tar.gz podman-90cf78b199772082025f22e4ebc0e30c133d2a88.tar.bz2 podman-90cf78b199772082025f22e4ebc0e30c133d2a88.zip |
Merge pull request #11290 from flouthoc/volume-export
volumes: Add support for `volume export` which allows exporting content to external path.
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/volume.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libpod/volume.go b/libpod/volume.go index 8f3dc4fcc..90b423f1d 100644 --- a/libpod/volume.go +++ b/libpod/volume.go @@ -139,6 +139,17 @@ func (v *Volume) MountPoint() (string, error) { return v.mountPoint(), nil } +// MountCount returns the volume's mountcount on the host from state +// Useful in determining if volume is using plugin or a filesystem mount and its mount +func (v *Volume) MountCount() (uint, error) { + v.lock.Lock() + defer v.lock.Unlock() + if err := v.update(); err != nil { + return 0, err + } + return v.state.MountCount, nil +} + // Internal-only helper for volume mountpoint func (v *Volume) mountPoint() string { if v.UsesVolumeDriver() { |