inode(4)
NAME
inode − format of an i-node
SYNOPSIS
#include <sys/types.h>
#include <ufs/inode.h>
DESCRIPTION
An i-node for a plain file or directory in a file system has the following structure defined by <ufs/inode.h>.
/∗ Inode structure as it appears on a disk block. ∗/
#define NDADDR 12 /∗ direct addresses in inode ∗/
#define NIADDR 3 /∗ indirect addresses in inode ∗/
struct inode {
struct inode ∗i_chain[2]; /∗ must be first ∗/
struct vnode i_vnode;/∗ vnode associated with this inode ∗/
struct vnode ∗i_devvp; /∗ vnode for block I/O ∗/
u_short i_flag;
dev_t i_dev;/∗ device where inode resides ∗/
ino_t i_number;/∗ i number, 1-to-1 with device address ∗/
int i_diroff;/∗ offset in dir, where we found last entry ∗/
struct fs ∗i_fs;/∗ file sys associated with this inode ∗/
struct dquot ∗i_dquot; /∗ quota structure controlling this file ∗/
long ∗i_filocks;/∗ pointer to filock (structure) list ∗/
union {
daddr_t if_lastr; /∗ last read (read-ahead) ∗/
struct socket ∗is_socket; /∗ IFSOCK ∗/
struct {
struct socket ∗if_rsocket; /∗ read socket ∗/
struct socket ∗if_wsocket; /∗ write socket ∗/
short if_frcnt; /∗ number of active readers ∗/
short if_fwcnt; /∗ number of active writers ∗/
} i_fifo;/∗ IFIFO ∗/
} i_un;
struct {
struct inode ∗if_freef; /∗ free list forward ∗/
struct inode ∗∗if_freeb; /∗ free list back ∗/
} i_fr;
struct icommon
{
u_short ic_mode; /∗ 0: mode and type of file ∗/
short ic_nlink; /∗ 2: number of links to file ∗/
short ic_uid;/∗ 4: owner’s user id ∗/
short ic_gid;/∗ 6: owner’s group id ∗/
quad ic_size;/∗ 8: number of bytes in file ∗/
time_t ic_atime; /∗ 16: time last accessed ∗/
long ic_atspare;
time_t ic_mtime; /∗ 24: time last modified ∗/
long ic_mtspare;
time_t ic_ctime; /∗ 32: last time inode changed ∗/
long ic_ctspare;
daddr_t ic_db[NDADDR]; /∗ 40: disk block addresses ∗/
daddr_t ic_ib[NIADDR]; /∗ 88: indirect blocks ∗/
long ic_flags; /∗ 100: status, currently unused ∗/
long ic_blocks; /∗ 104: blocks actually held ∗/
long ic_gen;/∗ 108: generation number ∗/
long ic_spare[4]; /∗ 112: reserved, currently unused ∗/
} i_ic;
};
For the meaning of the defined types off_t and time_t see types(5).
FILES
/usr/include/ufs/inode.h
SEE ALSO
CX/UX Programmer’s Reference Manual