MCPcopy Index your code
hub / github.com/rclone/rclone / ClearMappingsPrefix

Function ClearMappingsPrefix

fs/cache/cache.go:263–278  ·  view source on GitHub ↗

ClearMappingsPrefix deletes all mappings to parents with given prefix Returns number of entries deleted

(prefix string)

Source from the content-addressed store, hash-verified

261//
262// Returns number of entries deleted
263func ClearMappingsPrefix(prefix string) (deleted int) {
264 mu.Lock()
265 do := func(mapping map[string]string) {
266 for key, val := range mapping {
267 if !strings.HasPrefix(val, prefix) {
268 continue
269 }
270 delete(mapping, key)
271 deleted++
272 }
273 }
274 do(remap)
275 do(childParentMap)
276 mu.Unlock()
277 return deleted
278}
279
280// EntriesWithPinCount returns the number of pinned and unpinned entries in the cache
281//

Callers 1

ClearConfigFunction · 0.85

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…