2 // Look for missing lock releases before returning from a function.
6 // * The results of running this patch have to be carefully reviewed.
7 // Some functions legally return with the lock held, even if the
8 // below pattern matches. Some other functions begin with the lock
9 // held, only to release and then reaquire it again.
11 // * Consider using -timeout because it might run a long time
12 // (indefinitely?) on some files.
15 // crit_enter() / crit_exit()
20 ... when != crit_exit()
24 if (...) { ... when != crit_exit()
32 // get_mplock() / rel_mplock()
37 ... when != rel_mplock()
41 if (...) { ... when != rel_mplock()
49 // lockmgr(..., {LK_EXCLUSIVE,LK_SHARED}) / lockmgr(..., LK_RELEASE)
54 lockmgr(l,\(LK_SHARED\|LK_EXCLUSIVE\));
55 ... when != lockmgr(l,LK_RELEASE)
59 if (...) { ... when != lockmgr(l,LK_RELEASE)
60 + lockmgr(l,LK_RELEASE);
64 lockmgr(l,LK_RELEASE);
67 // lwkt_gettoken(...) / lwkt_reltoken(...)
73 ... when != lwkt_reltoken(l)
77 if (...) { ... when != lwkt_reltoken(l)
85 // lwkt_serialize_enter(...) / lwkt_serialize_exit(...)
90 lwkt_serialize_enter(l);
91 ... when != lwkt_serialize_exit(l)
95 if (...) { ... when != lwkt_serialize_exit(l)
96 + lwkt_serialize_exit(l);
100 lwkt_serialize_exit(l);
103 // spin_lock(...) / spin_unlock(...)
109 ... when != spin_unlock(l)
113 if (...) { ... when != spin_unlock(l)