Allocation Methods
Allocation method 決定 file logical block 要放在哪些 physical blocks。
file logical block i → physical device block ?Classical Choices
| Method | Core idea | Fast at | Main cost |
|---|---|---|---|
| D-OS-Ch14da-Contiguous_Allocation | one file = one contiguous run | sequential + direct access | external fragmentation、growth 難 |
| D-OS-Ch14db-Linked_Allocation | blocks form linked list | simple sequential growth | random access 差、pointer risk |
| D-OS-Ch14dc-Indexed_Allocation | pointers collected in index/inode | direct access、dynamic growth | index metadata overhead |
現代 file systems 常混合:extents、FAT、direct/indirect pointers、extent trees。
Allocation method 會和 D-OS-Ch14e-Free_Space_Management 綁在一起:前者決定「怎麼記錄 file 的 blocks」,後者提供「哪些 blocks 可用」。效能比較見 D-OS-Ch14dd-Allocation_Method_Performance。