{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Traverse have to read each block downside freelist

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

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 Grouping • store addresses of n free blocks in first free block • last address contains address of another n free blocks … Counting • 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 Directory Implementation Linear list of file names with pointers to file control blocks/inodes. • simple to program “foo” “bar” • 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 location location File File lookup Example of inode fetch … through directory – how can improve lookups? Remove Remove a file Steps: Representing Representing Large Files in Unix inode In Unix, the FileHdr (called an indexnode or inode) represents large files using a hierarchical block map. hierarchical direct block map (12 entries) indirect block Inodes are 128 bytes, packed into blocks. Each inode has 68 bytes of attributes and 15 block map entries. suppose block size = 8KB 12 direct block map entries in the inode can map 96KB of data. One indirect block (referenced by the inode) can map 16MB of data. One One double indirect block pointer in inode maps 2K indirect blocks. maximum file size is double indirect...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online