11.2 What are the advantages of the variation of linked allocation that uses a FAT to chain together the blocks of a file ?

11.3 Consider a system where free space is kept in a free-space list.

a. Suppose that the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain your answer.

b. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk I/O operations might be required to read the contents of a small local file at /a/b/c? Assume that none of the disk blocks is currently being cached.

c. Suggest a scheme to ensure that the pointer is never lost as a result of memory failure.

11.6 Consider a file system on a disk that has both logical and physical block sizes of 512 bytes. Assume that the information about each file is already in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these questions:

a. How is the logical-to-physical address mapping accomplished in this system? (For the indexed allocation, assume that a file is always less than 512 blocks long.)

b. If we are currently at logical block 10 (the last block accessed was block 10) and want to access logical block 4, how many physical blocks must be read from the disk?

a

• 令 逻辑地址 / 512 = x + remainder_y
• 物理块号 = z + x
• y 为块内偏移。

b 一次，因为可以直接计算出

• 令 逻辑地址 / 511 = x + remainder_y
• 顺着链表找到第 X+1 个物理块
• Y+1 作为块内偏移

b 4 次，因为是第 4 个逻辑块

• 令 逻辑地址 / 512 = x + remainder_y
• 块号为 index-map
• y 为块内偏移。

b 2 次，第一次寻找块号，第二次根据块号和块内偏移找到