이에 따르면커널 문서, 디렉토리 항목은 디스크에 저장되지 않습니다. 나는 그 디렉토리가 inode이고 해당 데이터 블록에는 파일 이름과 inode 블록 번호만 포함되어 있다고 생각합니다(아래 이미지 참조). 그러나 커널은 정확히 어떻게 파싱 됩니까 /home/foo/hello.c
? /
즉, 커널은 어떤 inode가 /
or 인지 어떻게 알 수 있습니까 /var
?
Directory Entry Cache (dcache)
------------------------------
The VFS implements the open(2), stat(2), chmod(2), and similar system
calls. The pathname argument that is passed to them is used by the VFS
to search through the directory entry cache (also known as the dentry
cache or dcache). This provides a very fast look-up mechanism to
translate a pathname (filename) into a specific dentry. Dentries live
in RAM and are never saved to disc: they exist only for performance.
The dentry cache is meant to be a view into your entire filespace. As
most computers cannot fit all dentries in the RAM at the same time,
some bits of the cache are missing. In order to resolve your pathname
into a dentry, the VFS may have to resort to creating dentries along
the way, and then loading the inode. This is done by looking up the
inode.