I've been reading this page, http://www.tldp.org/LDP/tlk/fs/filesystem.html, and I have trouble organizing all the different caches it's talking about. Especially, I don't understand the different scenarios of when each are used.
From the way I understood, there are
Buffer cache: Used by the VFS. Says that data buffers are put in the cache. I don't know if data buffers are the only thing in the Buffer cache. Also, I'm not sure if it's only used by the VFS.
VFS inode cache: After accessing a file, its inode is put into the cache for faster look up. I'm not sure if having the inode information means that the system no longer needs to go down the file system tree to the location (As in, if a file is under Documents, it will no longer need to reach Documents from root directory).
EXT2 (or other filesystems that use inodes) inode cache: Does this exist? It's never mentioned, but I'm assuming it exists.
VFS directory cache: Stores "directory name to inode" mappings. As the following quote says from the link, apparently you can get a VFS inode just with the VFS cache:
If there is no entry in the directory cache, the real file system gets the VFS inode either from the underlying file system or from the inode cache.
Then why do we even need a directory cache? Is this related to the dentry cache?
Dentry cache: Why is this not mentioned in the above article? Is it not related?