Greg Hartman | 76d05dc | 2016-11-23 15:51:27 -0800 | [diff] [blame^] | 1 | #ifndef _CACHE_H |
| 2 | #define _CACHE_H |
| 3 | |
| 4 | #include <stdint.h> |
| 5 | #include <com32.h> |
| 6 | #include "disk.h" |
| 7 | #include "fs.h" |
| 8 | |
| 9 | /* The cache structure */ |
| 10 | struct cache { |
| 11 | block_t block; |
| 12 | struct cache *prev; |
| 13 | struct cache *next; |
| 14 | void *data; |
| 15 | }; |
| 16 | |
| 17 | /* functions defined in cache.c */ |
| 18 | void cache_init(struct device *, int); |
| 19 | const void *get_cache(struct device *, block_t); |
| 20 | struct cache *_get_cache_block(struct device *, block_t); |
| 21 | void cache_lock_block(struct cache *); |
| 22 | size_t cache_read(struct fs_info *, void *, uint64_t, size_t); |
| 23 | |
| 24 | #endif /* cache.h */ |