summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
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() {