1 typedef struct Super Super;
2 typedef struct Group Group;
3 typedef struct Inode Inode;
4 typedef struct Dirent Dirent;
5 typedef struct Ext2 Ext2;
23 INDBLOCK = NDIRBLOCKS,
24 DINDBLOCK = INDBLOCK+1,
25 TINDBLOCK = DINDBLOCK+1,
26 NBLOCKS = TINDBLOCK+1,
30 /* some systems have these defined */
47 #define IEXEC EXT2_IEXEC
48 #define IWRITE EXT2_IWRITE
49 #define IREAD EXT2_IREAD
50 #define ISVTX EXT2_ISVTX
51 #define ISGID EXT2_ISGID
52 #define ISUID EXT2_ISUID
53 #define IFMT EXT2_IFMT
54 #define IFIFO EXT2_IFIFO
55 #define IFCHR EXT2_IFCHR
56 #define IFDIR EXT2_IFDIR
57 #define IFBLK EXT2_IFBLK
58 #define IFREG EXT2_IFREG
59 #define IFLNK EXT2_IFLNK
60 #define IFSOCK EXT2_IFSOCK
61 #define IFWHT EXT2_IFWHT
63 /* permissions in Inode.mode */
71 /* type in Inode.mode */
83 #define DIRLEN(namlen) (((namlen)+8+3)&~3)
91 u32int ninode; /* Inodes count */
92 u32int nblock; /* Blocks count */
93 u32int rblockcount; /* Reserved blocks count */
94 u32int freeblockcount; /* Free blocks count */
95 u32int freeinodecount; /* Free inodes count */
96 u32int firstdatablock; /* First Data Block */
97 u32int logblocksize; /* Block size */
98 u32int logfragsize; /* Fragment size */
99 u32int blockspergroup; /* # Blocks per group */
100 u32int fragpergroup; /* # Fragments per group */
101 u32int inospergroup; /* # Inodes per group */
102 u32int mtime; /* Mount time */
103 u32int wtime; /* Write time */
104 u16int mntcount; /* Mount count */
105 u16int maxmntcount; /* Maximal mount count */
106 u16int magic; /* Magic signature */
107 u16int state; /* File system state */
108 u16int errors; /* Behaviour when detecting errors */
110 u32int lastcheck; /* time of last check */
111 u32int checkinterval; /* max. time between checks */
112 u32int creatoros; /* OS */
113 u32int revlevel; /* Revision level */
114 u16int defresuid; /* Default uid for reserved blocks */
115 u16int defresgid; /* Default gid for reserved blocks */
117 /* the following are only available with revlevel = 1 */
118 u32int firstino; /* First non-reserved inode */
119 u16int inosize; /* size of inode structure */
120 u16int blockgroupnr; /* block group # of this super block */
121 u32int reserved[233]; /* Padding to the end of the block */
129 u32int bitblock; /* Blocks bitmap block */
130 u32int inodebitblock; /* Inodes bitmap block */
131 u32int inodeaddr; /* Inodes table block */
132 u16int freeblockscount; /* Free blocks count */
133 u16int freeinodescount; /* Free inodes count */
134 u16int useddirscount; /* Directories count */
146 u16int mode; /* File mode */
147 u16int uid; /* Owner Uid */
148 u32int size; /* Size in bytes */
149 u32int atime; /* Access time */
150 u32int ctime; /* Creation time */
151 u32int mtime; /* Modification time */
152 u32int dtime; /* Deletion Time */
153 u16int gid; /* Group Id */
154 u16int nlink; /* Links count */
155 u32int nblock; /* Blocks count */
156 u32int flags; /* File flags */
157 u32int block[NBLOCKS];/* Pointers to blocks */
158 u32int version; /* File version (for NFS) */
159 u32int fileacl; /* File ACL */
160 u32int diracl; /* Directory ACL or high size bits */
161 u32int faddr; /* Fragment address */
169 u32int ino; /* Inode number */
170 u16int reclen; /* Directory entry length */
171 u8int namlen; /* Name length */
172 char *name; /* File name */
176 MinDirentSize = 4+2+1+1