kern
annotate src/bdev.h @ 94:b3351d018ac6
read/write superblock, get/put inode
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 11 Dec 2011 11:12:30 +0200 |
parents | f83f50c17c3b |
children |
rev | line source |
---|---|
nuclear@90 | 1 #ifndef BDEV_H_ |
nuclear@90 | 2 #define BDEV_H_ |
nuclear@90 | 3 |
nuclear@90 | 4 #include "fs.h" /* for dev_t */ |
nuclear@90 | 5 |
nuclear@90 | 6 /* TODO buffer cache */ |
nuclear@90 | 7 |
nuclear@90 | 8 struct block_device { |
nuclear@90 | 9 int ata_dev; |
nuclear@90 | 10 uint32_t offset, size; |
nuclear@93 | 11 |
nuclear@93 | 12 /* Partition type (if the blkdev is a partition), otherwise 0. |
nuclear@93 | 13 * Used as just an extra sanity check to make sure we don't |
nuclear@93 | 14 * try to mount the wrong filesystem. |
nuclear@93 | 15 */ |
nuclear@93 | 16 int ptype; |
nuclear@90 | 17 }; |
nuclear@90 | 18 |
nuclear@90 | 19 struct block_device *blk_open(dev_t dev); |
nuclear@90 | 20 void blk_close(struct block_device *bdev); |
nuclear@90 | 21 |
nuclear@93 | 22 int blk_read(struct block_device *bdev, uint32_t blk, int count, void *buf); |
nuclear@93 | 23 int blk_write(struct block_device *bdev, uint32_t blk, int count, void *buf); |
nuclear@90 | 24 |
nuclear@91 | 25 dev_t bdev_by_name(const char *name); |
nuclear@91 | 26 |
nuclear@90 | 27 #endif /* BDEV_H_ */ |