Jump to content

Inode pointer structure: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Schultkl (talk | contribs)
mNo edit summary
Schultkl (talk | contribs)
No edit summary
Line 8: Line 8:
* 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)
* 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 10 blocks fit in to the ten direct pointers. However, a 13 block file needs the inode in addition to an indirect block to contain the eleventh address.
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 sixth pointer of the first indirect block (assuming ten direct pointers in the inode pointer structure).
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 sixth pointer of the first indirect block (assuming ten direct pointers in the inode pointer structure).

Revision as of 01:49, 27 January 2010

The inode pointer structure is a structure adopted by the inode of a file in the Unix File System (UFS) or other related file systems to list the addresses of a file's data blocks. 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:

  • 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 sixth pointer of the first indirect block (assuming ten 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 ext3 file system, popular with Linux users, is an example of one of the many UFS-based file systems to adopt the inode pointer structure.

References

  • Ext3 for large file systems, LWN.net, June 12, 2006.
  • Unix File System, Binu, accessed August 24, 2008.
  • A Basic UNIX Tutorial, Idaho State University, January 9, 1996.
  • Marshall Kirk McKusick (February 18, 1984). "A Fast File System for UNIX" (PDF). {{cite journal}}: Cite journal requires |journal= (help); Unknown parameter |coauthors= ignored (|author= suggested) (help)