Figure 101 Connection between struct procinode and struct inode

The remaining elements of the structure are only used if the inode represents a process-specific entry (which is therefore located in the proc/pid directory). Their meanings are as follows:

□ pid is a pointer to the pid instance of a process. Because it is possible to access a large amount of process-specific information this way, it is clear why a process-specific inode should be directly associated with this data.

□ proc_get_link and proc_read (which are collected in a union because only one at a time makes sense) are used to get process-specific information or to generate links to process-specific data in the Virtual Filesystem.

□ fd holds the filedescriptor for which a file in /proc/<pid>/fd/ presents information. With the help of fd, all files in this directory can use the same file_operations.

The meanings and use of these elements are discussed in detail in Section 10.1.7.

Continue reading here: Initialization

Was this article helpful?

0 0