2006-07-21 15:18:04 +02:00
|
|
|
struct buf {
|
|
|
|
int flags;
|
2006-08-12 13:38:57 +02:00
|
|
|
uint dev;
|
|
|
|
uint sector;
|
2011-08-26 16:08:29 +02:00
|
|
|
struct spinlock lock;
|
|
|
|
struct sleeplock sleeplock;
|
2007-08-24 21:32:36 +02:00
|
|
|
struct buf *prev; // LRU cache list
|
2006-08-13 00:34:13 +02:00
|
|
|
struct buf *next;
|
2007-08-24 21:32:36 +02:00
|
|
|
struct buf *qnext; // disk queue
|
2006-07-21 15:18:04 +02:00
|
|
|
uchar data[512];
|
|
|
|
};
|
2011-08-26 16:08:29 +02:00
|
|
|
#define B_VALID 0x1 // buffer has been read from disk
|
|
|
|
#define B_DIRTY 0x2 // buffer needs to be written to disk
|
2007-08-27 16:09:30 +02:00
|
|
|
|