1. Suppose we want to increase the maximum file size in the UNIX BSD file system. Which would increase the maximum file size the most, and why? You should assume that the baseline system has 1KB blocks (same size for data blocks, indirect blocks, doubly indirect blocks, etc.), and that a block pointer takes 4 bytes (thus, each indirect block holds 256 data block pointers, each doubly indirect block holds 256 indirect block pointers, etc.)
    1. a. Add a quadruply indirect block pointer to the file header.
      b. Increase the block size to 4KB (again, same size for data blocks and all types of indirect blocks).

  2. Explain what happens to the disk in UNIX when a user in a text editor saves a new file called "foo" into the current directory. Assume that foo is 15678 bytes in length. Explain what blocks get written out to the disk and when (assume that UNIX does metadata consistency and 30-second write-behind for user data but does not do any logging). Here’s the set of system calls that you may assume that the editor makes:

    fd = open(foo, O_CREAT|O_WRONLY);
    p = &editBuffer;
    numBlocks = editBufferSize / 1024;
    for (I = 0; I < numBlocks; I++) {
        write(fd, p, 1024);
             p += 1024;
    }

    lengthOfLastPartialBlock = editBufferSize % 1024;
    write(fd, p, lengthOfLastPartialBlock);
    close(fd);