block read/write function for kernel added
[guestos.git] / src / libbio / bio.h
blob3f0190e2351fddfa5211fe18bf60c0f8d4f7fd50
1 #ifndef BIO_H
2 #define BIO_H
4 #include <fs.h>
5 #include <buffer_head.h>
6 #include <types.h>
8 enum bio_type {
9 BI_read,
10 BI_write
13 struct bio {
14 sector_t bi_sector; /* first sector on disk of i/o operation */
15 struct block_device *bi_bdev; /* pointer to the block descriptor device */
16 blksize_t bi_size; /* size of data to transfer */
17 struct bio_operations *bi_ops; /* set of operation pointers */
18 enum bio_type bi_type; /* type of i/o operation */
19 struct buffer_head *bi_buff; /* kernel buffer */
20 bool bi_finished; /* tells i/o finished or not */
23 struct bio_operations {
24 int (*read_block) (struct bio *bio);
25 int (*write_block) (struct bio *bio);
28 extern struct bio_operations biops;
30 extern void buffer_io(struct bio *bio);
32 #endif