Chapter 6 File Management
Objectives
To study the file service function of an OS as the
lowest level provider of persistent storage. To consider typical file service
interfaces and implementations. To study how the functions of a file service
might be distributed.
Points to emphasise
- Naming. Pathnames and unique file identifiers. The
file identifiers (sometimes called handles) given to users may or may not
be the same as those used internally by the filing system.
- Sharing. Access control may be fine grained and
complex to implement or crude and simple. Why it is useful to have links
in addition to access control.
- Discuss the semantics of "write" and the
trade-offs in its implementation. You can do a fast, unsafe write or a
slow safe one.
- The file system implementor has to be concerned with
the consistency of data structures in main memory and those on disk.
- There are environments for filing systems other than
a university campus.
- The I/O bottleneck. Directions in which file services
are likely to evolve.
Possible difficulties
The student may find it difficult to understand
general issues when the local OS is very familiar. It may be useful to
emphasise different application environments and requirements on future systems
to store different types of data, such as multimedia, to create an open minded
attitude and an approach based on reasoning rather than local knowledge.
Teaching hints
- Directories are a good example of (persistent)
abstract data types. Who is the owner of a directory? Why cannot the owner
read and write an arbitrary byte sequence from/to a directory? The owner
is a client of the DS which is a client of the "byte-sequence file
service" (FS).
- The DS knows the internal structure of directories
which it stores as files on the FS. The FS does not know the internal
structure of any files stored on it. Ask the students for other system
services or utilities that use the FS in this way and themselves have
clients. (e.g. mail, database management systems, management utilities
which write error logs, spreadsheet packages).
- Ask the students to focus on what is in main memory
and what is on disk.
Consider a crash in which the contents of main
memory are lost. Suppose a write request requires that several blocks are
written out to disk and a crash occurs part way through. Suppose a crash occurs
between the writing out of metadata and data.
Consider the consequences of the loss of any
individual disk or on-disk data structure.
What are the implications of using a RAID scheme?
- Compare the projected performance n years ahead of
disks with that of processors. How will future filing systems cope?
Consider large client caches in main memory and on disk. How would the
shared file service be used?
- Give the example that a one-minute video clip
occupies 100 Mbytes and requires a sustained data transfer rate of 3
Mbits/s. Emphasise that the typical 4Kbyte block size and, for example, a
table of pointers, with indirection after the first few pointers, is
unsuitable for this kind of file.