Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在研究 jbd2 源代码,但我无法理解该BJ_Shadow标志对于给定的buffer_head.
BJ_Shadow
buffer_head
是BJ_Shadow给定的副本buffer_head还是什么?
当缓冲区处于BJ_Shadow状态时,这意味着该缓冲区的副本正在写入磁盘。
所以,基本上在事务提交时,要写入的缓冲区头(BH)处于BJ_Metadata状态,提交线程会复制这个BH用于IO提交。复制完成后,事务将 BH 的状态变为BJ_Shadow,最后 IO 完成后的最后一个状态为BJ_Forget状态。
BJ_Metadata
BJ_Forget