The kernel uses 3 data structures to represent open files, and the relationship between them determines the impact one process has on another process in terms of file sharing.
(1) Each process has a record entry in the process table, and the record entry contains an open file descriptor table, each of which is associated with each file descriptor
A. File descriptor flags
B. Pointers to a file table entry
(2) The kernel maintains a file table entry for all open files, with each file table entry containing:
A. File status (read/write synchronous non-blocking, etc.)
B. Current file offset
C. Pointers to the V-node (i-node) of the change file
(3) without opening a file or device, there is a v-node structure, the V node contains the file type and pointers to the operation function of the file, for most files, the V node also contains the node I node of the file, which is read from the disk in memory when the file is opened, so, All file information for a file is always available. The I node contains the owner of the file, the length of the file, pointers to the location of the file's actual data block on disk, and so on.
Most of the above summary comes from the Apue
The diagram shows the following:
Speaking of the More good blog:
Http://www.ruanyifeng.com/blog/2011/12/inode.html
http://blog.csdn.net/jnu_simba/article/details/8806654
Relationship of file descriptor, File table item pointer, inode node