INODE(5,F) AIX Technical Reference INODE(5,F)
-------------------------------------------------------------------------------
inode
PURPOSE
Describes a file system file or directory entry as it appears on a disk.
SYNOPSIS
#include <sys/types.h>
#include <sys/ino.h>
DESCRIPTION
An inode for an ordinary file or directory in a file system has the following
structure defined by sys/ino.h:
/* Inode structure as it appears on a disk block. */
#define NADDR 13
#define SMBLKSZ 384 /* bytes available in the inode for data */
struct dinode
{
unsigned short di_mode; /* mode and type of file */
short di_nlink; /* number of links to file */
short di_uid; /* owner's user id */
short di_gid; /* owner's group id */
ino_uniqid_t di_size; /* inode reuse count */
short di_filler; /* filler */
dflag_t di_dflag; /* disk flags */
off_t di_uniqid; /* unique identifier */
time_t di_mtime; /* time last modified */
time_t di_atime; /* time last accessed */
time_t di_ctime; /* time changed */
commitcnt_t di_cmtcnt; /* gfs commit seq number */
fstore_t di_fstore; /* file propagation attributes */
long di_version; /* version number this copy of data */
daddr_t di_blocks; /* actual number of blocks used */
char di_pad[27]; /*reserved for future use */
char di_sbflag; /* flags for small blocks */
daddr_t di_addr[NADDR]; /* disk block addresses */
char di_sbbuf[SMBLKSZ]; /* small block buffer */
};
The fields in the structure are as follows:
di_addr Array of thirteen 4-byte block numbers assigned to this file. The
first ten block numbers are direct addresses while the last three
are indirect addresses.
Processed November 7, 1990 INODE(5,F) 1
INODE(5,F) AIX Technical Reference INODE(5,F)
di_atime Time this file was last accessed.
di_blocks The number of file system blocks used by this file.
di_cmtcnt Commit sequence number; assigned when the file is committed.
Replicated files are propagated to other sites in the order in
which they were committed.
di_ctime Time this file or inode was last changed.
di_dflag Disk flags. DISOCKET, DIHIDDEN, and DILINK are used with flags in
di_mode to define additional file types. Other flags are:
DIDEL File has been deleted (the inode is unallocated).
DIALLOC The file is currently allocated.
DILONGDIR File is a directory with variable-sized entries. This
flag is set for all directories.
DISTORE The file is stored. In a non-replicated file system,
this flag is set in the same instances as DIALLOC. In
a replicated file system, this flag indicates that the
file is stored by this copy of the file system.
di_fstore File storage attribute. Used to determine on which sites a file in
a replicated file system is stored. This value is not used in a
non-replicated file system.
di_gid Group ID.
di_mode Type and access permissions of file. This field is encoded
identically to the st_mode field returned by the statx system call,
with the following exceptions:
Sockets are encoded with IFIFO in di_mode and DISOCKET in
di_dflag, rather than S_IFSOCK.
Hidden directories are encoded with IFDIR in di_mode and
DIHIDDEN in di_dflag, rather than S_IHIDDEN.
Symbolic links are encoded with IFREG in di_mode and DILINK in
di_dflag, rather than S_IFLNK.
di_mtime Time this file was last modified.
di_nlink Number of directory entries that name this file.
di_sbflag Has a nonzero value when the file is no more than SMBLKSZ bytes in
size. It indicates that the entire file content can be found in
di_sbbuf. All entries in di_addr are 0 when di_sbbuf is in use.
Processed November 7, 1990 INODE(5,F) 2
INODE(5,F) AIX Technical Reference INODE(5,F)
di_sbbuf The buffer to store the file content when di_sbflag is nonzero.
di_size Number of bytes in the file.
di_uid Owner ID.
di_uniqid Inode reuse count. This is incremented on file creation. Used to
determine if a file has been deleted and then had its inode reused.
This field corresponds to the st_gen field returned by statx.
di_version A count of the number of times a file has been updated.
See the types.h file for related information concerning the types used in
"struct dinode".
RELATED INFORMATION
In this book: "fs," "stat.h," and "types.h."
Processed November 7, 1990 INODE(5,F) 3