b_state 表示缓冲区的状态,合法的标志存放在 bh_state_bits中,该枚举在中定义。
enum bh_state_bits {
BH_Uptodate, /* Contains valid data *该缓冲区包含可用数据/
BH_Dirty, /* Is dirty 该缓冲区是脏的,缓冲区的内容比磁盘中的块内容要新,所以缓冲区的内容必须被写回磁盘*/
BH_Lock, /* Is locked 该缓冲区正在被I/O操作访问,被锁定以防止并发访问*/
BH_Req, /* Has been submitted for I/O *该缓冲区有I/O请求操作/
BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise
* IO completion of other buffers in the page
*/
BH_Mapped, /* Has a disk mapping 该缓冲区是映射磁盘块的可用缓冲区*/
BH_New, /* Disk mapping was newly created by get_block *缓冲区是通过get_block()刚刚映射的,尚且不能访问/
BH_Async_Read, /* Is under end_buffer_async_read I/O 该缓冲区正通过end_buffer_async_read()被异步I/O读操作使用*/
BH_Async_Write, /* Is under end_buffer_async_write I/O *该缓冲区正通过end_buffer_async_write()被异步写操作使用/
BH_Delay, /* Buffer is not yet allocated on disk *该缓冲区尚未与磁盘块关联/
BH_Boundary, /* Block is followed by a discontiguity *该缓冲区片于连续块区的边界,下一个块不再连续/
BH_Write_EIO, /* I/O error on write */
BH_Ordered, /* ordered write */
BH_Eopnotsupp, /* operation not supported (barrier) */
BH_PrivateStart,/* not a state bit, but the first bit available
* for private allocation by other entities
*/
};