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 /* permissions in Inode.mode */
38 /* type in Inode.mode */
50 #define DIRLEN(namlen) (((namlen)+8+3)&~3)
58 u32int ninode; /* Inodes count */
59 u32int nblock; /* Blocks count */
60 u32int rblockcount; /* Reserved blocks count */
61 u32int freeblockcount; /* Free blocks count */
62 u32int freeinodecount; /* Free inodes count */
63 u32int firstdatablock; /* First Data Block */
64 u32int logblocksize; /* Block size */
65 u32int logfragsize; /* Fragment size */
66 u32int blockspergroup; /* # Blocks per group */
67 u32int fragpergroup; /* # Fragments per group */
68 u32int inospergroup; /* # Inodes per group */
69 u32int mtime; /* Mount time */
70 u32int wtime; /* Write time */
71 u16int mntcount; /* Mount count */
72 u16int maxmntcount; /* Maximal mount count */
73 u16int magic; /* Magic signature */
74 u16int state; /* File system state */
75 u16int errors; /* Behaviour when detecting errors */
77 u32int lastcheck; /* time of last check */
78 u32int checkinterval; /* max. time between checks */
79 u32int creatoros; /* OS */
80 u32int revlevel; /* Revision level */
81 u16int defresuid; /* Default uid for reserved blocks */
82 u16int defresgid; /* Default gid for reserved blocks */
84 /* the following are only available with revlevel = 1 */
85 u32int firstino; /* First non-reserved inode */
86 u16int inosize; /* size of inode structure */
87 u16int blockgroupnr; /* block group # of this super block */
88 u32int reserved[233]; /* Padding to the end of the block */
96 u32int bitblock; /* Blocks bitmap block */
97 u32int inodebitblock; /* Inodes bitmap block */
98 u32int inodeaddr; /* Inodes table block */
99 u16int freeblockscount; /* Free blocks count */
100 u16int freeinodescount; /* Free inodes count */
101 u16int useddirscount; /* Directories count */
113 u16int mode; /* File mode */
114 u16int uid; /* Owner Uid */
115 u32int size; /* Size in bytes */
116 u32int atime; /* Access time */
117 u32int ctime; /* Creation time */
118 u32int mtime; /* Modification time */
119 u32int dtime; /* Deletion Time */
120 u16int gid; /* Group Id */
121 u16int nlink; /* Links count */
122 u32int nblock; /* Blocks count */
123 u32int flags; /* File flags */
124 u32int block[NBLOCKS];/* Pointers to blocks */
125 u32int version; /* File version (for NFS) */
126 u32int fileacl; /* File ACL */
127 u32int diracl; /* Directory ACL or high size bits */
128 u32int faddr; /* Fragment address */
136 u32int ino; /* Inode number */
137 u16int reclen; /* Directory entry length */
138 u8int namlen; /* Name length */
139 char *name; /* File name */
143 MinDirentSize = 4+2+1+1