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

Method EntriesWithPinCount

lib/cache/cache.go:267–278  ·  view source on GitHub ↗

EntriesWithPinCount returns the number of pinned and unpinned entries in the cache Each entry is counted only once, regardless of entry.pinCount

()

Source from the content-addressed store, hash-verified

265//
266// Each entry is counted only once, regardless of entry.pinCount
267func (c *Cache) EntriesWithPinCount() (pinned, unpinned int) {
268 c.mu.Lock()
269 for _, entry := range c.cache {
270 if entry.pinCount <= 0 {
271 unpinned++
272 } else {
273 pinned++
274 }
275 }
276 c.mu.Unlock()
277 return pinned, unpinned
278}

Callers 1

EntriesWithPinCountFunction · 0.80

Calls 2

LockMethod · 0.65
UnlockMethod · 0.65

Tested by

no test coverage detected