FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kPageCache Class Reference

Description

Helper class to support the implementation of a RAM page cache for a flash storage device.

At present, this class provides features to support a read cache. Additional support (e.g., dirty flags, eviction callbacks) would be required to support a writable cache.

Inheritance diagram for kPageCache:
Inheritance graph

Public Member Functions

kStatus kPageCache_AccessPage (kPageCache cache, kSize pageIndex, kPageCacheItem *page)
 Finds the cache page associated with the specified page index (if present) and updates LRU information for the page. More...
 
kStatus kPageCache_AllocatePage (kPageCache cache, kSize pageIndex, kPageCacheItem *page)
 Adds a page associated with the specified page index to the page cache. More...
 
kStatus kPageCache_Construct (kPageCache *cache, kSize pageCapacity, kSize pageSize, kSize spareSize, kAlloc allocator)
 Constructs a kPageCache object. More...
 
kStatus kPageCache_CopyFromPageData (kPageCache cache, kPageCacheItem page, kPointer dest, kSize length)
 Copies page data out of a cache page. More...
 
kStatus kPageCache_CopyFromPageSpare (kPageCache cache, kPageCacheItem page, kPointer dest, kSize length)
 Copies spare data out of a cache page spare area. More...
 
kStatus kPageCache_CopyToPageData (kPageCache cache, kPageCacheItem page, const kPointer source, kSize length)
 Copies page data into a cache page. More...
 
kStatus kPageCache_CopyToPageSpare (kPageCache cache, kPageCacheItem page, const kPointer source, kSize length)
 Copies spare data into a cache page spare area. More...
 
kStatus kPageCache_FindPage (kPageCache cache, kSize pageIndex, kPageCacheItem *page)
 Finds the cache page associated with the specified page index, if present. More...
 
kStatus kPageCache_Invalidate (kPageCache cache)
 Invalidates the entire page cache. More...
 
kStatus kPageCache_InvalidatePage (kPageCache cache, kSize pageIndex)
 Invalidates a specific page. More...
 
kStatus kPageCache_InvalidateRange (kPageCache cache, kSize pageIndex, kSize pageCount)
 Invalidates a ranges of pages. More...
 
kPointer kPageCache_PageData (kPageCache cache, kPageCacheItem page)
 Returns a pointer to a cache page data buffer. More...
 
kSize kPageCache_PageSize (kPageCache cache)
 Reports the page size for the cache. More...
 
kPointer kPageCache_PageSpare (kPageCache cache, kPageCacheItem page)
 Returns a pointer to a cache spare data buffer. More...
 
kSize kPageCache_SpareSize (kPageCache cache)
 Reports the spare size for the cache. More...
 

Related

kPointer kPageCacheItem
 Represents an entry within a kPageCache object.
 

The documentation for this class was generated from the following file: