Less known Solaris Features: CacheFS - Part 4: The Cache
Okay, we have a working CacheFS mount but where and how is the stuff cached by the system. Let´s have a look at the cache.
To ensure that caches using a single cache directory of the time aren´t mixing up their data, they are divided at this place. At first a special directory is generated and at second a more speaking name is liked to this. It´s pretty obvious how this name is generated.=theoden:_export_files:_files can be easily translated to theoden:/export/files mounted at /files
Let´s assume we´ve used the cache for another filesystem (e.g. /export/binaries on theoden</ode> mounted to /binaries):
With this mechanism, the caches are seperated in their respective directories … no mixing up.
When we dig down a little bit deeper to the directories, we will see an additional layer of directories. This is necessary to prevent a situation where a directory contains too much files and thus slows down.
When you look in on of this file, you will see, that those files are just a copy of the original files:
At last, the structure of CacheFS for storing the cache is pretty simple. The metadata of the cache (what file is stored in which location) is stored in the root directory of the cache in some dot-files:
All this dot-files in conjunction contain all the metadata necessary to manage and controle the cache.