Finding Entries
Userspace applications access proc files as if they were normal files in regular filesystems; in other words, they follow the same path as the VFS routines described in Chapter 8 when searching for entries. As discussed there, the lookup process (e.g., of the open system call) duly arrives at real_lookup, which invokes the function saved in the lookup function pointer of inode_operations to resolve the filename by reference to its individual path components. In this section, we take a look at the steps performed by the kernel to find files in the proc filesystem.
The search for entries starts at the mount point of the proc filesystem, usually /proc. In Section 10.1.2 you saw that the lookup pointer of the file_operations instance for the root directory of the process filesystem points to the proc_root_lookup function. Figure 10-3 shows the associated code flow diagram.
|
proc_root_lookup 1 | ||
|
proc_lookup1 | ||
|
proc_pid_lookup| | ||
Continue reading here: Figure 103 Code flow diagram for procrootlookup
Was this article helpful?