#ifndef BLOCKDEV_H #define BLOCKDEV_H #include "fileobj.h" int blockdev_read(struct file_object *fo, void *buffer, size_t n); int blockdev_write(struct file_object *fo, void *buffer, size_t n); int blockdev_seek(struct file_object *fo, size_t pos); struct blockdev_fops = { .write = &blockdev_write, .read = &blockdev_read, .seek = &blockdev_seek, }; struct bdops { int (*read_block)(struct block_device *bd, void *buffer, size_t n); int (*write_block)(struct block_device *bd, void *buffer, size_t n); }; struct block_device { size_t current_pos; struct bdops *bdops; }; #endif /* BLOCKDEF_H */