File and Disk Caching

Other versions of this page are also available for the following:

Windows Mobile Not SupportedWindows Embedded CE Supported

8/28/2008

File caching forms a significant part of an overall design strategy to significantly improve performance on Windows Embedded CE-based devices. Better caching not only improves performance, but also saves power; when an application accesses physical storage, the storage device uses much more power. The less often physical storage is accessed, the longer storage devices spend in a low-power state.

Windows Embedded CE includes two kinds of file caching services: file caching and disk caching.

  • File cache services are provided by the file system cache manager. The cache manager is a file system filter that can be applied to any file system driver (FSD) without making modifications to the FSD. The file system cache manager caches only file data.
  • Disk cache services are provided through a helper library that FSDs can link with to provide disk caching services to file systems. Typically, an FSD uses disk cache to cache file system metadata, such as directory entries. Disk cache also provides services for file contents.

In an optimal file system solution, the FSD might use the disk cache to cache its metadata and leave data caching to the file system cache manager.

The Windows Embedded CE file allocation table (FAT) file system drivers (FATFS, TFAT, and exFAT) can be configured to use the disk cache for file system metadata and file contents. For devices that use FAT, use the disk cache for FAT metadata and the file system cache manager for file contents.

The disk cache is an API, and adding it to a file system means that you add calls to the FSDMGR_ functions that implement the disk cache. The file cache is a file system filter, which you can add to a file system with registry settings that add the filter to the volume. Therefore, you must modify the code of the file system for the disk cache. For the file cache you need only modify registry settings. FATFS is already written to use the disk cache, so you can add or remove disk cache usage from FATFS by modifying FATFS registry settings.

If you are writing your own file system, you can use the disk cache by calling FSDMGR_ functions, such as FSDMGR_CreateCache.

If you are expecting your file system to be used primarily on Windows Embedded CE 6.0, use only the disk cache for caching file and directory metadata, and let the file cache filter cache file data.

Disk cache services are provided through a helper library that an FSD can link with to provide disk caching services to file systems.

In This Section

  • File Cache Management
    Provides descriptions of the file cache architecture, and links to information about configuring file cache settings.
  • Disk Cache Management
    Provides descriptions of the disk cache, and links to information about configuring disk cache settings.
  • FAT File System
    Describes the FAT file system drivers included with Windows Embedded CE.

See Also

Other Resources

File Systems