CS 537 Notes, Section #24: Unix and DEMOS Disk Allocation


OSTEP: Chapter 40

Storage Management: For a given file, how the does OS find the data blocks contained in that file? The data structure that decribes the contents of file is generically called a file descriptor. We will see several other names (like inode and MFTE), as we study about file systems.

The file descriptor information has to be stored on disk, so it will stay around even when the OS does not.


UNIX inode layout

The Classic Unix Inode


UNIX inode structure


The Demos File System

Demos was an operating system written especially for high performance systems, originally the Cray 1. Its design continues to influence systems today.

The Demos solution: allocates files contiguously, has more compact file descriptors, uses more CPU time. (refer to contiguous allocation picture in section 26).


Demos File Descriptor Structure

Even if it is possible to allocate in groups, how do you know when to do it? Use past history: if file is already big, it will probably get bigger.


What Else is Stored in an inode (File Descriptor)?

So, far, we have described the primary task of an inode to locate the data blocks in a file. Some of the other basic information that is found in a file descriptor includes:

Permissions:
Indicates who can read, write or execute the file.
Size:
Size of the file in bytes (important because files are allocated on disk in terms of blocks.
Owner:
The user ID and other information (like group ID on UNIX) about the creator of the file.
Time stamps:
The time that the was created, last referenced and last modified.

If you want to learn more about how the UNIX file system next evolved, you can check out this paper we cover in the graduate operating systems class (CS736):

M.K McKusick, W. N. Joy, S. J. Leffler, R. S. Fabry, A Fast File System for UNIX, ACM Trans. on Computer Systems, 2 3, August 1984, pp. 181-197.



Copyright © 2012, 2018, 2020 Barton P. Miller
Non-University of Wisconsin students and teachers are welcome to print these notes their personal use. Further reproduction requires permission of the author.