0,0 → 1,37 |
/* Inode table. This table holds inodes that are currently in use. In some |
* cases they have been opened by an open() or creat() system call, in other |
* cases the file system itself needs the inode for one reason or another, |
* such as to search a directory for a path name. |
* The first part of the struct holds fields that are present on the |
* disk; the second part holds fields not present on the disk. |
*/ |
|
#ifndef _INODE_H |
#define _INODE_H |
|
#include "super.h" |
|
#define NIL_INODE (inode_t *) 0 /* indicates absence of inode slot */ |
|
#define NO_SEEK 0 /* i_seek = NO_SEEK if last op was not SEEK */ |
#define ISEEK 1 /* i_seek = ISEEK if last op was SEEK */ |
|
typedef struct { |
mode_t i_mode; /* file type, protection, etc. */ |
nlink_t i_nlinks; /* how many links to this file */ |
offset_t i_size; /* current file size in bytes */ |
zone_t i_zone[V2_NR_TZONES]; /* zone numbers for direct, ind, and dbl ind */ |
|
/* The following items are not present on the disk. */ |
dev_t i_dev; /* which device is the inode on */ |
ino_t i_num; /* inode number on its (minor) device */ |
int i_count; /* # times inode used; 0 means slot is free */ |
int i_ndzones; /* # direct zones (NR_DZONES) */ |
int i_nindirs; /* # indirect zones per indirect block */ |
super_block_t *i_sp; /* pointer to super block for inode's device */ |
char i_seek; /* set on LSEEK, cleared on READ */ |
} inode_t; |
|
extern inode_t inode[NR_INODES]; |
|
#endif /* _INODE_H */ |