MCPcopy Create free account
hub / github.com/opencloud-eu/opencloud / checkSpace

Function checkSpace

opencloud/pkg/command/posixfs.go:222–244  ·  view source on GitHub ↗
(spacePath string)

Source from the content-addressed store, hash-verified

220}
221
222func checkSpace(spacePath string) {
223 spinner.Message("")
224 spinner.Suffix(fmt.Sprintf(" Checking space '%s'", spacePath))
225
226 info, err := os.Stat(spacePath)
227 if err != nil {
228 logFailure("Error accessing path '%s': %v", spacePath, err)
229 return
230 }
231 if !info.IsDir() {
232 logFailure("Error: The provided path '%s' is not a directory\n", spacePath)
233 return
234 }
235
236 spaceID, err := xattr.Get(spacePath, spaceIDAttrName)
237 if err != nil || len(spaceID) == 0 {
238 logFailure("Error: The directory '%s' does not seem to be a space root, it's missing the '%s' attribute\n", spacePath, spaceIDAttrName)
239 return
240 }
241
242 checkSpaceID(spacePath)
243 checkNodeIDs(spacePath)
244}
245
246func checkSpaceID(spacePath string) {
247 spinner.Message(" - checking space ID uniqueness")

Callers 1

checkSpacesFunction · 0.85

Calls 5

logFailureFunction · 0.85
checkSpaceIDFunction · 0.85
checkNodeIDsFunction · 0.85
StatMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected