<< Chapter < Page | Chapter >> Page > |
Modern file systems must address four general problems:
Disk Management: how should the disk sectors be used to represent the blocks of a file? The structure used to describe which sectorsrepresent a file is called the file descriptor.
Contiguous allocation: allocate files like segmented memory (give each disk sector a number from 0 up). Keep a free list of unusedareas of the disk. When creating a file, make the user specify its length, allocate all the space at once. Descriptor contains location and size.
Linked files: In file descriptor, just keep pointer to first block. In each block of file keep pointer to next block. It can alsokeep a linked list of free blocks for the free list.
Array of block pointers: file maximum length must be declared when it is created. Allocate an array to hold pointers to all theblocks, but do not allocate the blocks. Then fill in the pointers dynamically using a free list.
DOS FAT allocation table: A single File Allocation Table (FAT) that combines free list info and file allocation info. In filedescriptor, keep pointer to first block. A FAT table entry contains either (1) the block number of the next block in the file, (2) a distinguished "end offile" (eof) value, or (3) a distinguished "free" value.
None of these is a very good solution: what is the answer? First, and MOST IMPORTANT: understand the application. How are filesystems used?
Thus, the per-file cost must be low, but the performance of large files must be good. File systems must allow reasonably fastrandom access, extensibility.
Storage Management: For a given file, how the does OS find the blocks contained in that file? The data structure that decribes thecontents of file is generically called a file descriptor. We will see several other names, as we study about file systems.
The file descriptor information has to be stored on disk, so it will stay around even when the OS does not.
Notification Switch
Would you like to follow the 'Operating systems' conversation and receive update notifications?