Page 163 - DCAP403_Operating System
P. 163
Operating System
Notes a simple disk address, the overall list will be shorter, as long as the count is generally greater
than 1.
Figure 8.12: Free-space Management by Free Block Counting
Data Segment
0 1 2 3 4 5 6
O/S Oracle File Segment Data Data Data Data
Header Header Header
Free Free
List List
1 2
X Y
Instance Instance
8.11 Directory Implementation
Directories are generally simply files with a special interpretation. Some directory structures
contain the name of a file, its attributes and a pointer3 either into its FAT list or to its i-node.
This choice bears directly on the implementation of linking. If attributes are stored directly in
the directory node, (hard) linking is difficult because changes to the file must be mirrored in
all directories. If the directory entry simply points to a structure (like an i-node) that holds the
attributes internally, only that structure needs to be updated.
The simplest method is to use a linear list of file names with pointers to the data blocks. This
requires a linear search to find a particular entry. Hash tables are also used by some operating
systems - a linear list stores the directory entries but a hash function based on some computation
from the file name returns a pointer to the file name in the list. Thus, directory search time is
greatly reduced.
In UNIX, each entry in the directory contains just a file name and its i-node number. When a fi le
is opened, the file system takes the file name and locates its disk blocks. The i-node is read into
memory and kept there until the file is closed.
8.12 Summary
File is a named collection of data stored in a device.
File manager is an integral part of the operating system which is responsible for the
maintenance of secondary storage.
File system is a set of abstract data types that are implemented for the storage, hierarchical
organization, manipulation, navigation, access, and retrieval of data.
Disk file system is a file system designed for the storage of files on a data storage device,
most commonly a disk drive, which might be directly or indirectly connected to the
computer.
Flash file system is a file system designed for storing fi les on flash memory devices. Network
file system is a file system that acts as a client for a remote file access protocol, providing
access to files on a server.
156 LOVELY PROFESSIONAL UNIVERSITY