Relationship of file descriptor, File table item pointer, inode node

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.