Samstag, 17. Juli 2010

linux kernel : the states of a buffer head

linux kernel : the states of a buffer head

quoted from professional linux kernel architecture by Wolfgang Mauerer, page 975.

b_state, see the enum bh_state_bits

http://lxr.linux.no/#linux+v2.6.34.1/include/linux/buffer_head.h#L19

BH_Uptodate and BH_Dirty can also be active at the SAME TIME, and this is often the case.

Whereas BH_Update is set after a buffer has been filled with data from the block device, the kernel uses BH_Dirty to indicate that the data in memory have been modified BUT not yet been written back.

This may be appear to be confusing but must be remembered...

馮小剛:不要簡化「親愛」《蘋果日報》
http://www.youtube.com/watch?v=T9eMlVlto7E&feature=youtube_gdata

19enum bh_state_bits {
20 BH_Uptodate, /* Contains valid data */
21 BH_Dirty, /* Is dirty */
22 BH_Lock, /* Is locked */
23 BH_Req, /* Has been submitted for I/O */
24 BH_Uptodate_Lock,/* Used by the first bh in a page, to serialise
25 * IO completion of other buffers in the page
26 */
27
28 BH_Mapped, /* Has a disk mapping */
29 BH_New, /* Disk mapping was newly created by get_block */
30 BH_Async_Read, /* Is under end_buffer_async_read I/O */
31 BH_Async_Write, /* Is under end_buffer_async_write I/O */
32 BH_Delay, /* Buffer is not yet allocated on disk */
33 BH_Boundary, /* Block is followed by a discontiguity */
34 BH_Write_EIO, /* I/O error on write */
35 BH_Ordered, /* ordered write */
36 BH_Eopnotsupp, /* operation not supported (barrier) */
37 BH_Unwritten, /* Buffer is allocated on disk but not written */
38 BH_Quiet, /* Buffer Error Prinks to be quiet */
39
40 BH_PrivateStart,/* not a state bit, but the first bit available
41 * for private allocation by other entities
42 */
43};
親不見
愛無心
產不生
廠空空
麵無麥
運無車
導無道
兒無首
飛單翼
有雲無雨
開關無門
鄉里無郎
聖變怪

Keine Kommentare: