Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

inode pointer structure

From Wikipedia, the free encyclopedia
Hierarchy/layout for directing inodes in a Unix File System
This article includes alist of references,related reading, orexternal links,but its sources remain unclear because it lacksinline citations. Please helpimprove this article byintroducing more precise citations.(February 2012) (Learn how and when to remove this message)
Example of structure

Theinode pointer structure is a structure adopted by theinode of a file in theVersion 6 Unix file system,Version 7 Unix file system, andUnix File System (UFS) to list the addresses of a file'sdata blocks. It is also adopted by many related file systems, including theext3 file system, popular with Linux users.

Structure

[edit]

In the file system used inVersion 6 Unix, an inode contains eight pointers:[1]

  • 8direct pointer that directly point to blocks of a file with eight or fewer blocks;
  • 8singly indirect pointers (pointing to a block of direct pointers) for files with more than eight blocks.

In the file system used inVersion 7 Unix, an inode contains thirteen pointers:[2]

  • 10direct pointers that directly point to blocks of a file with eight or fewer blocks;
  • 1singly indirect pointer (pointing to a block of direct pointers)
  • 1doubly indirect pointer (pointing to a block of single indirect pointers)
  • 1triply indirect pointer (pointing to a block of doubly indirect pointers)

In theUnix file system, an inode contains fifteen pointers:[3]

  • 12direct pointers that directly point to blocks of the file's data
  • 1singly indirect pointer (pointing to a block of direct pointers)
  • 1doubly indirect pointer (pointing to a block of single indirect pointers)
  • 1triply indirect pointer (pointing to a block of doubly indirect pointers)

The levels of indirection indicate the number of pointer that must be followed before reaching actual file data.

Key features

[edit]

Fixed logical block size

[edit]

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 calledindirect blocks) are only allocated as needed. For example, in theUnix file system, 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

[edit]

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

[edit]

Unlike 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

[edit]
  1. ^Ritchie, Dennis M.;Thompson, Ken (July 1974)."The UNIX Time-Sharing System"(PDF).Communications of the ACM.17 (7): 369.
  2. ^Ritchie, Dennis M.;Thompson, Ken."The UNIX Time-Sharing System"(PDF).
  3. ^"The Structure of UFS File System Cylinder Groups".System Administration Guide.
Retrieved from "https://en.wikipedia.org/w/index.php?title=Inode_pointer_structure&oldid=1275961252"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp