0,0 → 1,62 |
/* Declaration of the basic used types which are part of the V1 and V2 inode |
* as it is on the disk (not in memory). |
*/ |
|
|
#ifndef _TYPE_H |
#define _TYPE_H |
|
#include <sys/time.h> |
|
/* Types used in disk, inode, etc. data structures. */ |
typedef unsigned short mode_t; /* file type and permissions bits */ |
typedef char nlink_t; /* number of links to a file */ |
typedef short dev_t; /* holds (major|minor) device pair */ |
typedef char gid_t; /* group id */ |
typedef unsigned short ino_t; /* i-node number */ |
typedef unsigned long offset_t; /* offset within a file */ |
typedef int pid_t; /* process id (must be signed) */ |
typedef short uid_t; /* user id */ |
typedef unsigned long zone_t; /* zone number */ |
typedef unsigned short zone1_t; /* zone number for V1 file systems */ |
typedef unsigned long block_num_t; /* block number */ |
typedef unsigned long bit_t; /* bit number in a bit map */ |
typedef unsigned short bitchunk_t; /* collection of bits in a bitmap */ |
|
typedef unsigned char u8_t; /* 8 bit type */ |
typedef unsigned short u16_t; /* 16 bit type */ |
typedef unsigned long u32_t; /* 32 bit type */ |
|
typedef char i8_t; /* 8 bit signed type */ |
typedef short i16_t; /* 16 bit signed type */ |
typedef long i32_t; /* 32 bit signed type */ |
|
//typedef unsigned long phys_bytes;/* physical addresses and lengths in bytes */ |
|
|
/* Declaration of the V1 inode as it is on the disk (not in core). */ |
typedef struct { /* V1.x disk inode */ |
mode_t d1_mode; /* file type, protection, etc. */ |
uid_t d1_uid; /* user id of the file's owner */ |
offset_t d1_size; /* current file size in bytes */ |
time_t d1_mtime; /* when was file data last changed */ |
gid_t d1_gid; /* group number */ |
nlink_t d1_nlinks; /* how many links to this file */ |
zone1_t d1_zone[V1_NR_TZONES]; /* block nums for direct, ind, and dbl ind */ |
} d1_inode_t; |
|
/* Declaration of the V2 inode as it is on the disk (not in core). */ |
typedef struct { /* V2.x disk inode */ |
mode_t d2_mode; /* file type, protection, etc. */ |
u16_t d2_nlinks; /* how many links to this file. HACK! */ |
uid_t d2_uid; /* user id of the file's owner. */ |
u16_t d2_gid; /* group number HACK! */ |
offset_t d2_size; /* current file size in bytes */ |
time_t d2_atime; /* when was file data last accessed */ |
time_t d2_mtime; /* when was file data last changed */ |
time_t d2_ctime; /* when was inode data last changed */ |
zone_t d2_zone[V2_NR_TZONES]; /* block nums for direct, ind, and dbl ind */ |
} d2_inode_t; |
|
#endif /* _TYPE_H */ |
|