75{
76 int frags_per_block = 0;
80 ULONG group_block = 0;
84
86
90
93
94 pExt2Sb->s_first_data_block = (pExt2Sb->s_log_block_size) ? 0 : 1;
96
98
100
101 if (!pExt2Sb->s_rev_level)
103
105 {
108 }
109
111 pExt2Sb->s_lastcheck = pExt2Sb->s_mtime = pExt2Sb->s_wtime;
112
113 if (!pExt2Sb->s_blocks_per_group)
114 pExt2Sb->s_blocks_per_group = Ext2Sys->
blocksize * 8;
115
116 pExt2Sb->s_frags_per_group = pExt2Sb->s_blocks_per_group * frags_per_block;
118
119 if (pExt2Sb->s_r_blocks_count >= pExt2Sb->s_blocks_count)
120 {
122 }
123
124
125
126
127
128 if (pExt2Sb->s_feature_incompat &
130 {
132
133 return true;
134 }
135
136retry:
137
138 Ext2Sys->
group_desc_count = (pExt2Sb->s_blocks_count - pExt2Sb->s_first_data_block
140
142 return false;
143
146
147 if (!pExt2Sb->s_inodes_count)
149
150
151
152
153
156
157
158
159
160
161
162
163 pExt2Sb->s_inodes_per_group = (pExt2Sb->s_inodes_count + Ext2Sys->
group_desc_count - 1)
165
167 pExt2Sb->s_inodes_per_group = Ext2Sys->
blocksize*8;
168
169
170
171
172
173
176
179
180
181
182
183
184
185 pExt2Sb->s_inodes_per_group &= ~7;
188
189
190
191
192 pExt2Sb->s_inodes_count = pExt2Sb->s_inodes_per_group * Ext2Sys->
group_desc_count;
193 pExt2Sb->s_free_inodes_count = pExt2Sb->s_inodes_count;
194
195
196
197
198
199
200
201
202
203
205
206
207
208
209
210
211 rem = ((pExt2Sb->s_blocks_count - pExt2Sb->s_first_data_block) %
212 pExt2Sb->s_blocks_per_group);
213
215 return false;
216
217 if (rem && (rem < overhead+50))
218 {
219 pExt2Sb->s_blocks_count -= rem;
220 goto retry;
221 }
222
223
224
225
226
227
228
230 {
232 }
233
234
236 {
238 }
239
240
242 {
244 }
245
246
247
248
249
250
251
252
253 group_block = pExt2Sb->s_first_data_block;
254 numblocks = 0;
255
256 pExt2Sb->s_free_blocks_count = 0;
257
259 {
261 {
262 numblocks = (pExt2Sb->s_blocks_count - pExt2Sb->s_first_data_block)
263 % pExt2Sb->s_blocks_per_group;
264
266 numblocks = pExt2Sb->s_blocks_per_group;
267 }
268 else
269 {
270 numblocks = pExt2Sb->s_blocks_per_group;
271 }
272
274 {
276
279
281 }
282
284
285 pExt2Sb->s_free_blocks_count += numblocks;
289
290 group_block += pExt2Sb->s_blocks_per_group;
291 }
292
293 return true;
294
296
300
301 return false;
302}
void ext2_free_inode_bitmap(PEXT2_FILESYS Ext2Sys)
bool ext2_allocate_block_bitmap(PEXT2_FILESYS Ext2Sys)
bool ext2_mark_bitmap(PEXT2_BITMAP bitmap, ULONG bitno)
bool ext2_allocate_inode_bitmap(PEXT2_FILESYS Ext2Sys)
void ext2_free_block_bitmap(PEXT2_FILESYS Ext2Sys)
void ext2_free_group_desc(PEXT2_FILESYS Ext2Sys)
bool ext2_bg_has_super(PEXT2_SUPER_BLOCK pExt2Sb, int group_block)
bool ext2_allocate_group_desc(PEXT2_FILESYS Ext2Sys)
#define EXT2_FIRST_INODE(s)
#define set_field(field, default)
static void cleanup(void)
#define EXT2_GOOD_OLD_FIRST_INO
#define EXT2_FRAG_SIZE(s)
#define EXT2_BLOCKS_PER_GROUP(s)
#define EXT2_ERRORS_DEFAULT
#define EXT2_DFL_CHECKINTERVAL
#define EXT2_DFL_MAX_MNT_COUNT
#define EXT2_GOOD_OLD_REV
#define EXT2_INODE_SIZE(sb)
#define EXT2_BLOCK_SIZE(sb)
#define EXT2_GOOD_OLD_INODE_SIZE
#define EXT2_DESC_PER_BLOCK(s)
#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
PEXT2_SUPER_BLOCK ext2_sb
unsigned long inode_blocks_per_group
PEXT2_BLOCK_BITMAP block_map
unsigned long desc_blocks
PEXT2_GROUP_DESC group_desc
__u16 bg_free_blocks_count
__u16 bg_free_inodes_count