Pinned buffer (source code)

= Pinned buffer

A <buffered device block> whose identity is retained for unfinished work. <Reference counting> can represent both client references and additional pins. Dropping a client reference does not release an outstanding journal pin; dropping a pin does not remove somebody else's reference. In the <buffer cache state model>, $r$ counts all such retained references, so $r>0$ prevents <buffer cache eviction>. This count keeps the structure alive; a <mutex> separately controls who can inspect or change its contents. Waiting callers also need lifetime protection.