xv6-simplified 0.1
简化版xv6
Loading...
Searching...
No Matches
buf.h
Go to the documentation of this file.
1
10#define BSIZE 512
11
12// buffer
13struct buf {
14 int valid; // 缓存中是否有数据
15 int disk; // 该缓存是否被磁盘所拥有
16 uint dev; // 设备号
17 uint sectorno; // 扇区号
18 /*struct sleeplock lock; */
19 uint refcnt; // 缓存的引用计数
20 struct buf *prev; // 指向LRU缓存替换算法中的前一个缓存
21 struct buf *next; // 指向LRU缓存替换算法中的后一个缓存
22 uchar data[BSIZE]; // 数据
23};
24
#define BSIZE
Definition buf.h:10
Definition buf.h:13
struct buf * prev
Definition buf.h:20
struct buf * next
Definition buf.h:21
int disk
Definition buf.h:15
uint dev
Definition buf.h:16
int valid
Definition buf.h:14
uint sectorno
Definition buf.h:17
uchar data[BSIZE]
Definition buf.h:22
uint refcnt
Definition buf.h:19
unsigned char uchar
Definition types.h:15
unsigned int uint
Definition types.h:11