2021SC@SDUSC
inode(2)
We've talked about inodes, so what are we doing here.After reading some blogs from several great coders, I finally notice that I am far from ultimately understand such structure, so I would like to start with inodes again about some new information.
One senior write in his blog that inode is actually the core of vfs, which means almost every operations to files are connected to this structure.One of the reason is that a inode directly map to single file, and you will have to access inode first before really started to read or write a file.One of the very important thing that ralated to inode is page cache.
Our cpu and ram runs a lot quicker than disks, and if we go to storage to get files every time we use them, it will be very slow than you ever expected, that is why all os realize their cache, so is linux kernal.So when you use a file which is recently used, the system will firstly check the cache for such file, if exsited, it won't go to hard disk for files again, instead they get file from cache.If the file being used is not in cache, the system will find it in disk and save it to the cache.Be aware that cache are quite smaller than any hardware so it is not possible to store all the files in cache, otherwise you won't need disks at all.So whe