blk.h (289B)
1 #define BLKSIZ 512 2 3 typedef struct blk Blk; 4 typedef struct blkphy Blkphy; 5 6 struct blk { 7 mutex_t m; 8 Blkphy *phy; 9 void *data; 10 }; 11 12 struct blkphy { 13 void (*init)(Blk *dev, Attr *attr); 14 int (*bread)(Blk *dev, long blkno, void *buf); 15 int (*bwrite)(Blk *dev, long blkno, void *buf); 16 };