GetUserCounters returns the user counters for the given KUID.
(uid auth.KUID)
| 2298 | |
| 2299 | // GetUserCounters returns the user counters for the given KUID. |
| 2300 | func (k *Kernel) GetUserCounters(uid auth.KUID) *UserCounters { |
| 2301 | k.userCountersMapMu.Lock() |
| 2302 | defer k.userCountersMapMu.Unlock() |
| 2303 | |
| 2304 | if uc, ok := k.userCountersMap[uid]; ok { |
| 2305 | return uc |
| 2306 | } |
| 2307 | |
| 2308 | uc := &UserCounters{} |
| 2309 | k.userCountersMap[uid] = uc |
| 2310 | return uc |
| 2311 | } |
| 2312 | |
| 2313 | // AddDevGofer initializes the dev gofer connection and starts tracking it. |
| 2314 | // It takes ownership of goferFD. |
no test coverage detected