Test 4 - File Management

CS 505, Operating Systems Concepts


  1. A colleague of yours administers a system that uses sequential allocation to assign free blocks to files. When you suggest that the file system suffers from poor disk-space utilization, your colleague says that it doesn't; in fact, utilization is almost 100%. What size are the files in your colleague's system? Explain.


    Because there's almost no internal fragmentation, the file sizes must be close to a multiple of the disk block size. Because there's almost no external fragmentation, the file sizes must all be the same multiple of the disk block size.

    A lot of people got this right, but didn't do as well as they could have becasue they forgot one or the other type of fragmentation. A couple of people answered "it's one big file", which is technically correct, but isn't quite the answer I was expecting.


  2. Explain how you would integrate a quick-fit allocation scheme with the multiple levels of indirection provided by Unix i-nodes.


    The characteristic of quick-fit important to this question is that it organizes the free list into blocks of fixed and increasing size. Unix i-nodes have the property that, as files get larger, the level indirection increases, from direct to single, double, and triple indirection.

    The combination of i-nodes and quick-fit suggests that as the level of indirection grows, so should the size of the file blocks allocated at each level of indirection. For example, direct blocks linked out of the i-node would be one disk-block long; first-level indirect blocks would be two disk-blocks long, second-level indirect blocks would be four disk-blocks long, and so on.

    Almost nobody got this correct, apparently because most people forgot what quick-fit is. The most popular wrong answer involved implementing some form of free list using i-nodes, which represents an abuse of both i-nodes and free lists.


  3. Which is more appropriately implemented in a paged memory manager: authentication or authorization? Explain.


    The question of identity important in paging is the process needing the page, and possibly the process losing a page. Becuase process identities are internal and maintained by the operating system, there is no real need to authenticate identity. On the other hand, a page can be accessed in a number of ways: read-only, write-only, or for execution, and these may vary from process to process. It seems it's more appropriate for a page manager to worry about authorization than authentication.

    Most people sorta got this one mostly correct, although the explanations were far from clear. A number of people confused the need to identify something (page, a page frame, a slot in the paging space) with the need to prove identity (authentication).


  4. You are implementing a file system that uses two-level indirection to keep track of file-data blocks. Explain how you would translate the file pointer position p into a file-block address.


    Assume each disk block can hold b units, where each unit is large enough to hold an disk-block index. Each disk block at the first level of indirection then refers to b*b consecutive units in a file. The block at the second level of indirection refers to b first-level indirect blocks.

    Given p, the address of some unit in the file, the associated first-level indirect block can be found at floor(p/(b*b)) in the top-level indirect block. Within the first-level indirect block, the data-block index can be found at floor((p mod b*b)/b). Within the data block, the indexed word can be found at p mod b.

    A number of people answered this question without a lot of detail ("First go to the top-level block, then go to the first-level block, then to the data block"); they didn't do as well as those people who actually described how to go from one block to another.



This page last modified on 22 August 2002.