Inode pointer structure
Encyclopedia

The inode pointer structure is a structure adopted by the inode
Inode
In computing, an inode is a data structure on a traditional Unix-style file system such as UFS. An inode stores all the information about a regular file, directory, or other file system object, except its data and name....

 of a file in the Unix File System
Unix File System
The Unix file system is a file system used by many Unix and Unix-like operating systems. It is also called the Berkeley Fast File System, the BSD Fast File System or FFS...

 (UFS) or other related file systems to list the addresses of a file's data blocks
File system
A file system is a means to organize data expected to be retained after a program terminates by providing procedures to store, retrieve and update data, as well as manage the available space on the device which contain it. A file system organizes data in an efficient manner and is tuned to the...

. In the past, the structure may have consisted of eleven or thirteen pointers, but most modern file systems use fifteen pointers. These pointers consist of (assuming 15 pointers in the inode):
  • Twelve pointers that directly point to blocks of the file's data (direct pointers)
  • One singly indirect pointer (a pointer that points to a block of pointers that then point to blocks of the file's data)
  • One doubly indirect pointer (a pointer that points to a block of pointers that point to other blocks of pointers that then point to blocks of the file's data)
  • One triply indirect pointer (a pointer that points to a block of pointers that point to other blocks of pointers that point to other blocks of pointers that then point to blocks of the file's data)


The structure is partially illustrated in the diagram accompanying this article. The structure allows for inodes to describe very large files in a file systems with a fixed logical block size. Central to the mechanism is that blocks of addresses (also called indirect blocks) are only allocated as needed. For example, a 12-block file would be described using just the inode because its blocks fit in to the number of direct pointers available. However, a 13-block file needs an indirect block to contain the thirteenth address.

The inode pointer structure not only allows for files to easily be allocated to non-contiguous blocks, it also allows the data at a particular location inside a file to be easily located. This is possible because the logical block size is fixed. For example, if each block is 8 kB, file data at 120 to 128 kB would be pointed to by the third pointer of the first indirect block (assuming twelve direct pointers in the inode pointer structure).

Unlike the inodes, which are fixed in number and allocated in a special part of the file system, the indirect blocks may be of any number and are allocated in the same part of the file system as data blocks. The number of pointers in the indirect blocks are dependent on the block size and size of block pointers. Example: with a 512 byte block size, and 4 byte block pointers, each indirect block can consist of 128 (512 / 4) pointers. The ext3
Ext3
The ext3 or third extended filesystem is a journaled file system that is commonly used by the Linux kernel. It is the default file system for many popular Linux distributions, including Debian...

file system, popular with Linux users, is an example of one of the many UFS-based file systems to adopt the inode pointer structure.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK