Unformatted text preview: t)
• Linked list of free disk blocks –space?
• Traverse: have to read each block (downside) free_list • Cannot get contiguous space easily
• store addresses of n free blocks in first free block
• last address contains address of another n free blocks …
• since blocks are most likely to be allocated/deallocated in chunks;
keep track of first free block and number n of contiguous blocks
that follow (less to store)
FAT (like bit-vector): built in mechanism for free space handling FreeFree-Space Management (Cont.)
In all of these schemes, caching will be used heavily
For example, bit map is on disk but also cached in memory
allocate[i]: inode updated to include new block I
mem[i] <= 1
disk[i] <= 1
What order (hint: think crash)? Directory
Linear list of file names with pointers to file control blocks/inodes.
• simple to program
• time-consuming to find a file!
• sort them or … Hash Table – linear list with hash data structure.
• decreases directory search time
• collisions – situations where two file names hash to the same
Example of inode fetch … through directory – how can
improve lookups? Remove
Remove a file
Representing Large Files in Unix
inode In Unix, the FileHdr (called an indexnode or inode) represents large files using
a hierarchical block map.
(12 entries) indirect
block Inodes are 128 bytes, packed into blocks.
Each inode has 68 bytes of attributes and 15 block map
suppose block size = 8KB
12 direct block map entries in the inode can map 96KB
One indirect block (referenced by the inode) can map
16MB of data.
One double indirect block pointer in inode maps 2K
maximum file size is double
View Full Document
- Summer '14
- Operating Systems