From d0c3c98acd02d412d271ebb9608d8a9cd0e23a32 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 29 Oct 2019 00:04:39 -0700 Subject: filesystem: rename getMountInfo() to loadMountInfo() Make it clearer that this function loads data into global data structures, and doesn't return anything. --- filesystem/mountpoint.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'filesystem/mountpoint.go') 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] -- cgit v1.2.3