The filesystem has two caches. The metadata cache is used to cache portions of the directory, freelist and BATs. The data cache is used to contain blocks of file data. The two caches are identical other than that the metadata cache uses small (typically 4KiB) segments, while the data cache operates in terms of whole filesystem blocks. The caches also cause disk transfers originated from different caches to have different priorities.
The cache module exports a variety of functions for reading and writing directory entries in the directory, block numbers in the freelist and BATs, and for accessing file data. These functions perform the necessary translations into sector addresses and access the appropriate cache.