summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-08-23 14:01:20 -0400
committerGitHub <noreply@github.com>2021-08-23 14:01:20 -0400
commit90cf78b199772082025f22e4ebc0e30c133d2a88 (patch)
treee890e717d5b5ce7bc51821776607464a7759271d /libpod
parent6a3741598cc30216a1a8db7d2c917e19bc37002b (diff)
parentedddfe8c4f7761b12dc64ea4aa0a83b755aa124f (diff)
downloadpodman-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.go11
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() {