Codebase list fscrypt / d0c3c98
filesystem: rename getMountInfo() to loadMountInfo() Make it clearer that this function loads data into global data structures, and doesn't return anything. Eric Biggers 4 years ago
1 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
5656 uuidDirectory = "/dev/disk/by-uuid"
5757 )
5858
59 // getMountInfo populates the Mount mappings by parsing the filesystem
59 // loadMountInfo populates the Mount mappings by parsing the filesystem
6060 // description file using the getmntent functions. Returns ErrBadLoad if the
6161 // Mount mappings cannot be populated.
62 func getMountInfo() error {
62 func loadMountInfo() error {
6363 if mountsInitialized {
6464 return nil
6565 }
121121 func AllFilesystems() ([]*Mount, error) {
122122 mountMutex.Lock()
123123 defer mountMutex.Unlock()
124 if err := getMountInfo(); err != nil {
124 if err := loadMountInfo(); err != nil {
125125 return nil, err
126126 }
127127
140140 mountMutex.Lock()
141141 defer mountMutex.Unlock()
142142 mountsInitialized = false
143 return getMountInfo()
143 return loadMountInfo()
144144 }
145145
146146 // FindMount returns the corresponding Mount object for some path in a
157157
158158 mountMutex.Lock()
159159 defer mountMutex.Unlock()
160 if err = getMountInfo(); err != nil {
160 if err = loadMountInfo(); err != nil {
161161 return nil, err
162162 }
163163
188188
189189 mountMutex.Lock()
190190 defer mountMutex.Unlock()
191 if err = getMountInfo(); err != nil {
191 if err = loadMountInfo(); err != nil {
192192 return nil, err
193193 }
194194
231231 // Lookup mountpoints for device in global store
232232 mountMutex.Lock()
233233 defer mountMutex.Unlock()
234 if err := getMountInfo(); err != nil {
234 if err := loadMountInfo(); err != nil {
235235 return nil, err
236236 }
237237 mnts, ok := mountsByDevice[devicePath]