HW10 Solutions 1. File systems 1.1 The data pointed to by the direct block pointers can be as large as 1024 * 8 bytes. There is a single indirect block pointer, and it can contain as many as 1024 / 4 pointers, each of which points to 1024 bytes of data. Thus, the total is: 1024 * 8 + 1024 * (1024 / 4) = (2^13 + 2^18) = 270,336 B. 1.2 Assume directories are implemented as files. Also, each directory entry is 16 bytes (14 bytes for the file name and 2 bytes for the inode number, since there are 2^16 inodes). Thus, we take our answer to the previous question and divide by 16 bytes: 2^13 + 2^18 / 2^4 = 2^9 + 2^14 = 16896. Since there are 2^16 inodes on the disk, our answer is min{2^16, 16896} = 16896. 2. Synchronous operations cannot return until both locations are updated and persistent. If these two inode arrays are stored on the first and second half of the same disk, it requires a seek for all operations. Reads, however, could be slightly faster: the system could seek to the closer version of the inode (but since there is only one copy of the data itself, the total gain is likely to be limited). 3. Your friend forgot that contiguous virtual addresses may not be contiguous in physical memory. For example, if we have mappings: va: 0x1000 --> pa: 0x8000 va: 0x2000 --> pa: 0x5000 then the scheme described would do the wrong thing for disk writes larger than a page size: the disk would write pa 0x8000 through 0x9FFF.