High Performance File System

written by: Matthew Duncan; article published: year 2010, month 06;

In: Root » Computers and technology » Data security

  Share  
|
  PL  |  NL  |  FR  |  ES  |  PT  |  IT  |  DE  |  DK  |  NO  |  SE  |  FI  |  GR  |  JP  |  CN  |  KR  |  RU  |  AE


The High Performance File System used by OS/2 uses an entirely different storage scheme from DOS. The basic unit of storage used by the HPFS scheme is the sector. Sectors are identified by Relative Sector Numbers, each of which is 32-bits long-sufficient to encode 4,294,967,296 sectors or a total disk space of 2048 gigabytes. Sectors are numbered sequentially, starting with the first one in the HPFS partition. Files are allocated in multiples of single sectors; directories, however, are made from one or more blocks of four sectors.

Each file or directory on the disk is identified by its File NODE, which stores descriptive data about the file or directory. This information includes file attributes, creation date, modification dates, access dates, sizes, and a pointer that indicates in which sector the data in the file is stored. Each File NODE is one sector (512 bytes) long. Up to 254 bytes of the File NODE of a disk file store an extended file name, which can include upper and lower space characters, some punctuation (for example, periods), and spaces.

As with a DOS file system, an HPFS disk organizes its storage from a root directory. In an HPFS system, however, the root directory does not have a fixed location or size. Instead, the root directory is identified by reference to the disk Super Block, which is a special sector that is always kept as the sixteenth sector from the beginning of the HPFS partition. The twelfth and thirteenth bytes-that is, at an offset of 0C(Hex) from the start of the block-of the Super Block points to the location of the root directory File NODE. Free space on the disk is identified by a bit-mapped table.

As with other FNODEs, a pointer in the root directory FNODE stores the location of the first block of four sectors assigned to the root directory. The root directory is identical to the other directories in the HPFS hierarchy, and like them it can expand or shrink as the number of files it contains changes. If the root directory needs to expand beyond its initial four sectors, it splits into a tree-like structure. The File Node of the root directory then points to the base File Node of the tree, and each pointer in the tree points to one directory entry and possibly a pointer to another directory node that may in turn point to entries whose names are sorted before the pointer entry. This structure provides a quick path for finding a particular entry, along with a simple method of scanning all entries.

The HPFS shares with DOS the ability to accommodate any length file (that will fit in the partition, of course) by assigning multiple allocation units (sectors in the case of the HPFS) which need not be contiguous. The HPFS, however, pre-allocates sectors to a file at the time it is opened, so a file may be assigned sectors that do not contain active data. The File NODE of the file maintains an accurate total of the sectors that are actually used for storing information. This pre-allocation scheme helps prevent files from becoming fragmented. Normally, the block of sectors assigned to a file will be contiguous, and the file will not become fragmented until all the contiguous sectors have been used up.

Two types of sectors are used to track the sectors assigned a given file. For files that have few fragments, the File NODE maintains a list of all the Relative Sector Numbers of the first sector in a block of sectors used by the file as well as the total number of sectors in the file before those of each block. To capture all the data in a file, OS/2 finds the Relative Sector Number of the first block of sectors used by the file and the total number of sectors in the block. It then checks the next Relative Sector Number and keeps counting with a running total of sectors in the file.

If a file has many fragments, it uses a tree-style table of pointers to indicate the location of each block of sectors. The entry in the file's File NODE table then stores pointers to the sectors, which themselves store pointers to the data. Each of these sectors identifies itself as to whether it points to data, or more pointers, with a special flag.

Besides its huge capacity, the HPFS has significant advantages when dealing with large hierarchies of directories, directories containing large number of files, and large files. Although both the HPFS and DOS use tree-structured directory systems, the directories in the HPFS are not arranged like a tree. Each director is stored in a tree-like structure that, coupled with the presorting of entries automatically performed by the HPFS, allows faster searches of large directories. The HPFS also arranges directories on the disk to reduce the time required to access them-instead of starting at the edge of the disk, they fan out from the center.

Share

Disclaimer

1) E-articles is not responsible for the information contained by this article as well for any and all copyright infringements by authors and writers. E-articles is a free information resource. If you suspect this article for any copyright infringement, please read the terms of service and contact us or use the "Report this article" button on this page to investigate the problem.
2) E-articles is not responsible for inaccuracies, falsehoods, or any other types of misinformation this article may contain and will not be liable for any loss or damage suffered by a user through the user's reliance on the information gained here.