linux VFS
http://zhumeng8337797.blog.163.com/blog/static/100768914201011156513311/?suggestedreading&wumii
http://zhumeng8337797.blog.163.com/blog/static/100768914201351751829608/?suggestedreading&wumii
http://zhumeng8337797.blog.163.com/blog/static/100768914201110245856546/
http://www.cnblogs.com/XjChenny/archive/2012/12/18/2823735.html
http://www.inf.fu-berlin.de/lehre/SS01/OS/Lectures/Lecture16.pdf
The main components of the common file model are
– superblock (information about mounted filesystem)
– inode (information about a specific file)
– file (information about an open file)
– dentry (information about directory entry)
Each process has its own current working directory and its own root directory, this is stored in an fs
_ struct in the fs field of the process descriptor
• The open files of a process are stored in a files_struct in the files field of the process descriptor
– When performing an open() system call, the file descriptor is actually an index into an array of the file objects in the fd array field of the process descriptors files field
• For example, current->files-> fd[1] is standard output for the process
The first block in all Ext2 partitions is always reserved for the boot sector
• The remainder of the partition is split into block groups
– All block groups are the same size and are stored sequentially on the disk
– Block groups reduce file fragmentation, since the kernel tries to keep the data blocks belonging to a file in the one block group if possible
Only the superblock and group descriptors in block group 0 are used by the kernel
• Block group size depends on partition and block size
– 8GB partition with 4KB block, has 32k bits in block bitmap or 128MB; therefore 64 block groups are needed