The old original


The initial UNIX file system structure was quite suitable for the small disks of the time. It had a master table at the beginning, giving information about the structure and layout of the disk data. This was known as the superblock. Following this was an index, or table, of information about every file on the disk. This contained file "nodes" that told the system how to actually locate the file data, which was kept farther out in a general data area making up the rest of the file system. These were known as index nodes, or inodes, and kept everything about the file except the name . On the rest of the disk were found the data files themselves , including directories (which were treated just like regular files) that associated a name with the data. Directories were a slightly special case, and the data in them was rigorously formatted: There was a 14-character name, followed by a 2-byte index number that identified the inode for the file.

This entire structure was quite restrictive , but it was sufficient ” for a while. The first method of expanding this structure was to put more than one file system on a disk. The physical disk was partitioned into a maximum of eight different areas, each of which could have a different, independent file system on it. This was very significant when larger disks became available, because with this basic file system structure, you were limited to a 16-bit number to identify the inode, meaning you could only have 65,000 files in a file system.

The BSD file system

Work done at Berkeley to expand and enhance UNIX included massive changes to the file system structure. The basic idea was to try to minimize seeks. The first change was to intermingle inodes with the data, thus having the information about the file close to the contents of the file. After you open up a file, you are probably going to issue a read (or write) request quite soon thereafter, and the disk will be in a better position to satisfy that request. This concept is referred to as "cylinder groups," that is, grouping related data in the same bunch of cylinders . Other changes involved decisions on where to put the data in a file, keeping track of the free blocks on the disk, and doing I/O in larger-sized chunks rather than in small disk-sector sized pieces (which are normally 512 bytes). All in all, the developers were quite successful in speeding up the disk and making much larger file systems possible. The BSD file system has become a de facto standard for UNIX systems.

Broadening horizons

It soon became desirable to have UNIX understand other file system types, especially for transportable media, and to be able to access data on remote systems. The combination of these led to a more "virtual" or object-oriented approach to dealing with files and file systems. A VFS, Virtual File System, layer was inserted in the kernel to make referencing other types of file system structures possible. Below this virtual layer you could put routines to do general tasks on different layouts, for example, remote systems, CD-ROMs, and floppy disks.

The same concept was extended to cover files within a file system, since an inode was very UFS-specific. A "virtual inode," or vnode , was defined to describe files in general terms. It also contained a pointer to functions that would implement general operations in a specific kind of file system for a certain type of file. When the kernel starts getting down to the level where file system-specific code takes over, the vnode's type-specific functions will be invoked.



PANIC. UNIX System Crash Dump Analysis Handbook
PANIC! UNIX System Crash Dump Analysis Handbook (Bk/CD-ROM)
ISBN: 0131493868
EAN: 2147483647
Year: 1994
Pages: 289
Authors: Chris Drake

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net