buf
其实BUF应该为BUFF但是在国产的游戏中很多人都喜欢用英文简写,而且打的不全,就把BUFF给打成BUF了。
基本信息
- 外文名
buf
- 全称
buffer
- 结构成员
int b_flags;int b_error等
- 用途
用来存放数据
基本内容
buf 结构
在驱动模块中的解释
以下 buf 结构成员对块驱动程序很重要:
int b_flags; /* Buffer Status */
struct buf *av_forw; /* Driver work list link */
struct buf *av_back; /* Driver work list link */
size_t b_bcount; /* # of bytes to transfer */
union {
caddr_t b_addr; /* Buffer's virtual address */
} b_un;
daddr_t b_blkno; /* Block number on device */
diskaddr_t b_lblkno; /* Expanded block number on device */
size_t b_resid; /* # of bytes not transferred */
/* after error */
int b_error; /* Expanded error field */
void *b_private; /* “opaque” driver private area */
dev_t b_edev; /* expanded dev field */其中:
av_forw 和 av_back驱动程序可用以管理其使用的一组缓冲区的指针。有关 av_forw 和 av_back 指针的讨论,请参见异步数据传输(块驱动程序)。