written 5.5 years ago by |
So far, this chapter has described the structure of a file, assuming that the i-node was previously bound to a file and that the disk blocks containing the data were already assigned. The next sections cover how the kernel assigns i-nodes and disk blocks. To understand those algorithms, let us examine the some fields of the super block.
The super block consists of the following fields:
• The size of the file system,
• The number of free blocks available in the file system,
• A list of free blocks available on the file system,
• The next free block index in the free block list,
• The size of the i-node list,
• The number of free i-nodes in the file system,
• A list of free i-nodes in the file system,
• The index of the next free i-node in the free i-node list, lock fields for the free block and free i-node lists,
• A flag indicating that the super block has been modified,
The kernel periodically writes the super block to disk if it had been modified so that it is consistent with the data in the file system.