UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department
CS 537
Spring 2001
A. Arpaci-Dusseau
Quiz #8: April 25th -- File Systems
Name: Student ID #:

Problem 1: Buffering (15 points)

Scheduling, buffering, and caching are three roles performed by the I/O subsystem within the OS. List three reasons why the buffering of data is useful or necessary.







Problem 2: Directories (20 points)

Consider a file in the Unix file system named /a/b/c. How many reads of data blocks are required to find the i-node number of this file? You may assume that all i-nodes are cached in memory and that each directory file is one block long. In your answer, describe the purpose of each disk read.






Problem 3: Links (15 points)

Consider the case where a link (hard or soft) is made from an existing file or directory, A, to a new file or directory, B. Mark if each statement is true of hard links (H), soft (symbolic) links (S), both (B), or neither (N).
____  When B is created, the reference count in the i-node of A is incremented.

____  When the contents of A are changed, the contents of B change as well.

____  When the contents of B are changed, the contents of A change as well.

____  When A is removed (e.g., with "rm A"), B still exists.

____  When B is removed (e.g., with "rm B"), A still exists.

____  A and B can be directories.

____  Can be used to create cycles in the directory hierarchy.

Problem 4: Allocation and Meta-Data (20 points)

Match the file allocation algorithm with the meta-data that it requires to track where all of the file-data is located. Select the single best answer and use each response only once.


____ Linked                a.  Single pointer to file-data and its size
____ Indexed               b.  Array containing multiple pointers and their sizes
____ Contiguous            c.  Pointer to first block of file
____ Extent-based          d.  Array containing pointers to every block of file


Problem 5: I-nodes (30 points)

Consider a UNIX file system with 10 direct pointers, 1 indirect pointer, 1 double-indirect pointer, and 1 triple-indirect pointer in the i-node. Assume that disk blocks are 4K bytes and that each pointer to a disk block requires 4 bytes.

A)What is the largest possible file that can be supported with this design? Show your work (as an expression) to make sure you get credit; if your expression is correct, you will get full credit (i.e., you shouldn't calculate the final numeric answer!).




















B) Assume that the operating system has already read the i-node for your file into main memory (i.e., the file buffer cache). How many disk reads are required to read data block number 800 into memory? To assure full credit, describe each disk read.