HOME

TheInfoList



OR:

The inode pointer structure is a structure adopted by the
inode The inode (index node) is a data structure in a Unix-style file system that describes a file-system object such as a file or a directory. Each inode stores the attributes and disk block locations of the object's data. File-system object attribute ...
of a file in the Unix File System (UFS) to list the addresses of a file's data blocks. It is also adopted by many related file systems, including the ext3 file system, popular with Linux users.


Structure

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)


Key features


Fixed logical block size

The structure is partially illustrated in the diagram accompanying this article. The structure allows for inodes to describe very large files in 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 into the number of direct pointers available. However, a 13-block file needs an indirect block to contain the thirteenth address.


Ease of data location

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 112 kB to 120 kB would be pointed to by the third pointer of the first indirect block (assuming twelve direct pointers in the inode pointer structure).


Indirect blocks

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 is 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.


References


Ext3 for large file systems
LWN.net, June 12, 2006. * {{cite journal , author1=
Marshall Kirk McKusick Marshall Kirk McKusick (born January 19, 1954) is a computer scientist, known for his extensive work on BSD UNIX, from the 1980s to FreeBSD in the present day. He was president of the USENIX Association from 1990 to 1992 and again from 2002 ...
, author2=
William N. Joy William Nelson Joy (born November 8, 1954) is an American computer engineer and venture capitalist. He co-founded Sun Microsystems in 1982 along with Scott McNealy, Vinod Khosla, and Andy Bechtolsheim, and served as Chief Scientist and CTO at ...
, author3=
Samuel J Leffler Samuel J Leffler is a computer scientist, known for his extensive work on BSD, from the 1980s to FreeBSD in the present day. Among other projects, he created FlexFAX, LibTIFF, and the FreeBSD Wireless Device Drivers. The ''Design and Imple ...
, author4=Robert S. Fabry , title=A Fast File System for UNIX , date=February 18, 1984 , url=http://www.cs.berkeley.edu/~brewer/cs262/FFS.pdf Unix file system technology