Buffer cache validity (source code)

= Buffer cache validity

Whether a <buffered device block>'s contents are ready for the requested use. Reserving a <buffer cache key> does not make its previous occupant's contents valid. A read fills the reserved structure before exposing its contents. A second caller finding an unfinished fill must wait; finding the identity is not yet a data <cache hit> under the convention used here. A failed fill must not expose the stale contents as valid.

A buffered partial write first needs the untouched <bytes>: read the old contents on a <cache miss>, change the requested range, and retain the result as a <dirty buffer>. A complete overwrite can initialize every <byte> without reading the old contents if the interface permits that path. The <buffer cache access trace> deliberately uses partial writes, so every <cache miss> reads the old block.