|
AquilaOS documentation
How it works, and its code
|
Go to the source code of this file.
Data Structures | |
| struct | bcache |
| A filesystem's block cache (fs/bcache.c): its blocks that were read, by their offset. More... | |
Functions | |
| void | bcache_init (struct bcache *bcache) |
| Sets up an empty block cache. | |
| int | bcache_insert (struct bcache *bcache, uint64_t off, void *data) |
| Adds a block to a cache, which keeps its memory from now on. | |
| int | bcache_remove (struct bcache *bcache, uint64_t off) |
| Takes a block out of a cache. | |
| void * | bcache_find (struct bcache *bcache, uint64_t off) |
| Finds a cached block. | |
Finds a cached block.
| bcache | the cache |
| off | the block's number |
Definition at line 100 of file bcache.c.
References bcache_find(), cache_block::data, hashmap_node::entry, hashmap_node::hash, bcache::hashmap, and NULL.
Referenced by bcache_find(), and minix_bcache_get().
| void bcache_init | ( | struct bcache * | bcache | ) |
Sets up an empty block cache.
| bcache | the cache |
Definition at line 35 of file bcache.c.
References bcache_eq(), bcache_init(), and bcache::hashmap.
Referenced by bcache_init(), bcache_insert(), and minix_load().
Adds a block to a cache, which keeps its memory from now on.
| bcache | the cache, set up on first use |
| off | the block's number |
| data | its contents |
Definition at line 48 of file bcache.c.
References bcache_init(), bcache_insert(), cache_block::data, bcache::hashmap, kmalloc(), M_ZERO, and cache_block::off.
Referenced by bcache_insert(), and minix_bcache_get().
Takes a block out of a cache.
| bcache | the cache |
| off | the block's number |
Definition at line 73 of file bcache.c.
References bcache_remove(), hashmap_node::entry, hashmap_node::hash, bcache::hashmap, kfree(), NULL, and cache_block::off.
Referenced by bcache_remove(), minix_block_free(), and table_alloc().