summaryrefslogtreecommitdiff
path: root/buf.h
blob: 0745be50919e4aa81d87891bfebcd8d9c6f482bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
struct buf {
  int flags;
  uint dev;
  uint blockno;
  struct sleeplock lock;
  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