Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

stat(2)

inode(4)

fs(4)

efs(4)

types(5)

EFSINODE(4)  —  Silicon Graphics

NAME

efsinode − format of an Extent file system inode

SYNOPSIS

#include <sys/param.h>
#include <sys/inode.h>

DESCRIPTION

An inode under the Extent file system has the following structure. 

#defineEFS_DIRECTEXTENTS12
 /*
 * Extent based file system inode as it appears on disk.
 * The efs inode is 128 bytes long.
 */
structefs_dinode {
ushortdi_mode;/* type and access permissions */
shortdi_nlink;    /* number of links */
ushortdi_uid;      /* owner’s user id number */
ushortdi_gid;      /* group’s group id number */
off_tdi_size;     /* number of bytes in file */
time_tdi_atime;/* time of last access (to contents) */
time_tdi_mtime;/* of last modification (of contents) */
time_tdi_ctime;/* of last modification to inode */
time_tdi_etime;/* time last extended */
shortdi_numextents;/* # of extents */
shortdi_unused;/* UNUSED */
union {
extentdi_extents[EFS_DIRECTEXTENTS];
dev_tdi_dev;/* device for IFCHR/IFBLK */
} di_u;
};

The types ushort, off_t, time_t, and dev_t are defined in types(5). The extent type is defined as follows. 

/*
 * Extent descriptor structure used in Extent file system inodes.
 * There are two kinds of extents descriptors:  direct and indirect.
 *
 * A direct extent descriptor maps a logical segment of its file to
 * to a physical segment (i.e., extent)  on the volume.  The physical
 * segment is characterized by a starting address and a length, both
 * in basic blocks.  The direct extent descriptor as used here contains
 * a logical file offset, also in basic blocks.
 *
 * An array of indirect extent descriptor’s maps a file to an array of
 * direct extent descriptors on the volume.
 */
typedef structextent {
unsigned intex_magic:8,/* magic #, must be 0 */
ex_bn:24,/* bb # on volume */
ex_length:8,/* length of this extent in bb’s */
ex_offset:24;/* logical file offset in bb’s */
} extent;

di_mode contains the type of the file (plain file, directory, etc), and its read, write, and execute permissions for the file’s owner, group, and public.  di_nlink contains the number of links to the inode.  Correctly formed directories have a minimum of two links: a link in the directory’s parent and the ‘.’ link in the directory itself.  Additional links may be caused by ‘..’ links from subdirectories.  di_uid and di_gid contain the user id and group id of the file (used to determine which set of access permissions apply: owner, group, or public).  di_size contains the length of the file in bytes. 

di_atime is the time of last access to the file’s contents.  di_mtime is the time of last modification of the file’s contents.  di_ctime is the time of last modification of the inode, as opposed to the contents of the file it represents.  di_etime is the time of last extension of the file.  These times are given in seconds since the beginning of 1970 GMT. 

di_numextents is the number of extents claimed by the file.  If less than or equal to EFS_DIRECTEXTENTS then the extent descriptors appear directly in the inode as di_u.di_extents[0 .. di_numextents-1]. When the number of extents exceeds this range, then the di_u.di_extents are used to contain a list of indirect extents.  The field di_u.di_extents[0].ex_offset is used to contain the number of indirect extents.  Indirect extents are pointers to blocks holding extent information.  There are at most EFS_DIRECTEXTENTS indirect extents. 

If the inode is a block or character special inode, di_u.di_numexents is 0, and di_u.di_dev contains a number identifying the device. 

FILES

/usr/include/sys/param.h
/usr/include/sys/types.h
/usr/include/sys/inode.h
/usr/include/sys/stat.h

SEE ALSO

stat(2), inode(4), fs(4), efs(4), types(5). 

Version 2.4  —  May 08, 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026