MCPcopy
hub / github.com/seaweedfs/seaweedfs / afterRelease

Method afterRelease

weed/filer/posixlock/manager.go:221–230  ·  view source on GitHub ↗

afterRelease prunes the session index when sid no longer holds any lock on key, and drops the set when it empties. Only sid's presence can have changed, since a release only removes sid's locks.

(key string, s *Set, sid uint64)

Source from the content-addressed store, hash-verified

219// and drops the set when it empties. Only sid's presence can have changed, since
220// a release only removes sid's locks.
221func (m *Manager) afterRelease(key string, s *Set, sid uint64) {
222 if s.Empty() {
223 delete(m.byKey, key)
224 m.deindex(sid, key)
225 return
226 }
227 if !setHasSession(s, sid) {
228 m.deindex(sid, key)
229 }
230}
231
232func (m *Manager) index(sid uint64, key string) {
233 keys := m.bySid[sid]

Callers 3

UnlockMethod · 0.95
ReleasePosixOwnerMethod · 0.95
ReleaseFlockOwnerMethod · 0.95

Calls 3

deindexMethod · 0.95
setHasSessionFunction · 0.85
EmptyMethod · 0.80

Tested by

no test coverage detected