|
ginnOS
The reference: libc, the libraries and the kernel
|
a sector cache in front of a block device. More...
Go to the source code of this file.
Data Structures | |
| struct | block_cache_slot_t |
| struct | block_cache_t |
Macros | |
| #define | BLOCK_CACHE_SETS 256 |
| #define | BLOCK_CACHE_WAYS 4 |
| #define | BLOCK_CACHE_SECTOR 512 |
Functions | |
| kerr_t | block_cache_init (block_cache_t *cache, block_device_t *backing) |
| put a cache in front of a device with 512-byte sectors. | |
Variables | |
| block_cache_t * | block_cache_root |
| the cache that serves the root filesystem, for /proc/meminfo (NULL before it is set up). | |
a sector cache in front of a block device.
a block_cache_t is itself a block device: reads are served from memory when the sectors are cached; writes go to the device at once (write through) and update the cached copies, so the disk is never behind.
the cache holds BLOCK_CACHE_SETS * BLOCK_CACHE_WAYS sectors. a sector can be in one of the BLOCK_CACHE_WAYS slots of its set (lba % sets); a miss replaces the least recently used slot of the set.
| #define BLOCK_CACHE_SETS 256 |
| #define BLOCK_CACHE_WAYS 4 |
| #define BLOCK_CACHE_SECTOR 512 |
| kerr_t block_cache_init | ( | block_cache_t * | cache, |
| block_device_t * | backing ) |
put a cache in front of a device with 512-byte sectors.
| cache | the cache (lives as long as the device is used). |
| backing | the device to cache. |
|
extern |
the cache that serves the root filesystem, for /proc/meminfo (NULL before it is set up).