Linux buffer_head

enum bh_state_bits {
    BH_Uptodate,    /* Contains valid data */
    BH_Dirty,        /* Is dirty */
    BH_Lock,        /* Is locked */
    BH_Req,            /* Has been submitted for 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 */
    BH_Async_Read,        /* Is under end_buffer_async_read I/O */
    BH_Async_Write,        /* Is under end_buffer_async_write I/O */
    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_Unwritten,        /* Buffer is allocated on disk but not written */
    BH_Quiet,            /* Buffer Error Prinks to be quiet */
    BH_Meta,            /* Buffer contains metadata */
    BH_Prio,            /* Buffer should be submitted with REQ_PRIO */
    BH_Defer_Completion, /* Defer AIO completion to workqueue */

    BH_PrivateStart,        /* not a state bit, but the first bit available
                             * for private allocation by other entities
                             */
};


struct buffer_head {
    unsigned long b_state;                /* buffer state bitmap (see above) */
    struct buffer_head *b_this_page;    /* circular list of page's buffers */
    struct page *b_page;                /* the page this bh is mapped to */

    sector_t b_blocknr;                    /* start block number */
    size_t b_size;                        /* size of mapping */
    char *b_data;                        /* pointer to data within the page */

    struct block_device *b_bdev;
    bh_end_io_t *b_end_io;                /* I/O completion */
     void *b_private;                    /* reserved for b_end_io */
    struct list_head b_assoc_buffers;     /* associated with another mapping */
    struct address_space *b_assoc_map;    /* mapping this buffer is associated with */
    atomic_t b_count;                    /* users using this buffer_head */
};




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值