2

I'm reading the book "Linux Kernel Development", and there are some important points:

  1. inode doesn't include filename.
  2. filenames are stored in directory entry(dentry).
  3. but dentry is not stored on disk, it's dynamic generated.

Unlike the previous two objects, the dentry object does not correspond to any sort of on-disk data structure.TheVFS creates it on-the-fly from a string representation of a path name. Because the dentry object is not physically stored on the disk, no flag in struct dentry specifies whether the object is modified (that is, whether it is dirty and needs to be written back to disk).

So the question is: where exactly the file names store? and how "list directory" works?

Ethan Xu
  • 121
  • @EsaJokinen thanks for your link. I checked through the answers and seems no one answered where did dentry get the filename. since dentry is dynamic generated, there must be a place to store such information. correct me if I'm wrong. thanks. – Ethan Xu Jan 15 '21 at 05:48
  • Why would it need to be stored if it is dynamically generated? – Tero Kilkanen Jan 15 '21 at 07:39
  • I think I found the answer: https://unix.stackexchange.com/questions/398434/why-no-file-name-in-inode-information – Ethan Xu Jan 16 '21 at 00:10

0 Answers0