aboutsummaryrefslogtreecommitdiff
path: root/filesystem/mountpoint.go
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-10-29 00:04:39 -0700
committerEric Biggers <ebiggers@google.com>2019-10-29 00:04:39 -0700
commitd0c3c98acd02d412d271ebb9608d8a9cd0e23a32 (patch)
treeadbcc4fe9763b4c09ce6336ffedfc274cf6541a3 /filesystem/mountpoint.go
parent9d7a4bf93c0d20a7eb2f07ef2ef63834f2cbf6a9 (diff)
filesystem: rename getMountInfo() to loadMountInfo()
Make it clearer that this function loads data into global data structures, and doesn't return anything.
Diffstat (limited to 'filesystem/mountpoint.go')
-rw-r--r--filesystem/mountpoint.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/filesystem/mountpoint.go b/filesystem/mountpoint.go
index 2905481..3dc1934 100644
--- a/filesystem/mountpoint.go
+++ b/filesystem/mountpoint.go
@@ -57,10 +57,10 @@ var (
uuidDirectory = "/dev/disk/by-uuid"
)
-// getMountInfo populates the Mount mappings by parsing the filesystem
+// loadMountInfo populates the Mount mappings by parsing the filesystem
// description file using the getmntent functions. Returns ErrBadLoad if the
// Mount mappings cannot be populated.
-func getMountInfo() error {
+func loadMountInfo() error {
if mountsInitialized {
return nil
}
@@ -122,7 +122,7 @@ func getMountInfo() error {
func AllFilesystems() ([]*Mount, error) {
mountMutex.Lock()
defer mountMutex.Unlock()
- if err := getMountInfo(); err != nil {
+ if err := loadMountInfo(); err != nil {
return nil, err
}
@@ -141,7 +141,7 @@ func UpdateMountInfo() error {
mountMutex.Lock()
defer mountMutex.Unlock()
mountsInitialized = false
- return getMountInfo()
+ return loadMountInfo()
}
// FindMount returns the corresponding Mount object for some path in a
@@ -158,7 +158,7 @@ func FindMount(path string) (*Mount, error) {
mountMutex.Lock()
defer mountMutex.Unlock()
- if err = getMountInfo(); err != nil {
+ if err = loadMountInfo(); err != nil {
return nil, err
}
@@ -189,7 +189,7 @@ func GetMount(mountpoint string) (*Mount, error) {
mountMutex.Lock()
defer mountMutex.Unlock()
- if err = getMountInfo(); err != nil {
+ if err = loadMountInfo(); err != nil {
return nil, err
}
@@ -232,7 +232,7 @@ func getMountsFromLink(link string) ([]*Mount, error) {
// Lookup mountpoints for device in global store
mountMutex.Lock()
defer mountMutex.Unlock()
- if err := getMountInfo(); err != nil {
+ if err := loadMountInfo(); err != nil {
return nil, err
}
mnts, ok := mountsByDevice[devicePath]