1 struct buf { 2 int flags; 3 uint dev; 4 uint sector; 5 struct buf *prev; 6 struct buf *next; 7 uchar data[512]; 8 }; 9 #define B_BUSY 0x1 // buffer is locked by some process 10 #define B_VALID 0x2 // buffer contains the data of the sector 11