summaryrefslogtreecommitdiff
path: root/buf.h
blob: 3266495cf3d9841760c2a23209342005404c2520 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
struct buf {
  int flags;
  uint dev;
  uint blockno;
  struct sleeplock lock;
  uint refcnt;
  struct buf *prev; // LRU cache list
  struct buf *next;
  struct buf *qnext; // disk queue
  uchar data[BSIZE];
};
#define B_VALID 0x2  // buffer has been read from disk
#define B_DIRTY 0x4  // buffer needs to be written to disk