diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ext2/ialloc.c | 24 | ||||
-rw-r--r-- | fs/ext2/inode.c | 2 | ||||
-rw-r--r-- | fs/ext3/ialloc.c | 17 | ||||
-rw-r--r-- | fs/ext4/ialloc.c | 17 |
4 files changed, 23 insertions, 37 deletions
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c index 4a9746b9afb7..2625a00c4669 100644 --- a/fs/ext2/ialloc.c +++ b/fs/ext2/ialloc.c | |||
@@ -177,7 +177,6 @@ static void ext2_preread_inode(struct inode *inode) | |||
177 | unsigned long block_group; | 177 | unsigned long block_group; |
178 | unsigned long offset; | 178 | unsigned long offset; |
179 | unsigned long block; | 179 | unsigned long block; |
180 | struct buffer_head *bh; | ||
181 | struct ext2_group_desc * gdp; | 180 | struct ext2_group_desc * gdp; |
182 | struct backing_dev_info *bdi; | 181 | struct backing_dev_info *bdi; |
183 | 182 | ||
@@ -188,7 +187,7 @@ static void ext2_preread_inode(struct inode *inode) | |||
188 | return; | 187 | return; |
189 | 188 | ||
190 | block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); | 189 | block_group = (inode->i_ino - 1) / EXT2_INODES_PER_GROUP(inode->i_sb); |
191 | gdp = ext2_get_group_desc(inode->i_sb, block_group, &bh); | 190 | gdp = ext2_get_group_desc(inode->i_sb, block_group, NULL); |
192 | if (gdp == NULL) | 191 | if (gdp == NULL) |
193 | return; | 192 | return; |
194 | 193 | ||
@@ -217,11 +216,10 @@ static int find_group_dir(struct super_block *sb, struct inode *parent) | |||
217 | int ngroups = EXT2_SB(sb)->s_groups_count; | 216 | int ngroups = EXT2_SB(sb)->s_groups_count; |
218 | int avefreei = ext2_count_free_inodes(sb) / ngroups; | 217 | int avefreei = ext2_count_free_inodes(sb) / ngroups; |
219 | struct ext2_group_desc *desc, *best_desc = NULL; | 218 | struct ext2_group_desc *desc, *best_desc = NULL; |
220 | struct buffer_head *bh, *best_bh = NULL; | ||
221 | int group, best_group = -1; | 219 | int group, best_group = -1; |
222 | 220 | ||
223 | for (group = 0; group < ngroups; group++) { | 221 | for (group = 0; group < ngroups; group++) { |
224 | desc = ext2_get_group_desc (sb, group, &bh); | 222 | desc = ext2_get_group_desc (sb, group, NULL); |
225 | if (!desc || !desc->bg_free_inodes_count) | 223 | if (!desc || !desc->bg_free_inodes_count) |
226 | continue; | 224 | continue; |
227 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) | 225 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) |
@@ -231,7 +229,6 @@ static int find_group_dir(struct super_block *sb, struct inode *parent) | |||
231 | le16_to_cpu(best_desc->bg_free_blocks_count))) { | 229 | le16_to_cpu(best_desc->bg_free_blocks_count))) { |
232 | best_group = group; | 230 | best_group = group; |
233 | best_desc = desc; | 231 | best_desc = desc; |
234 | best_bh = bh; | ||
235 | } | 232 | } |
236 | } | 233 | } |
237 | if (!best_desc) | 234 | if (!best_desc) |
@@ -284,7 +281,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
284 | int max_debt, max_dirs, min_blocks, min_inodes; | 281 | int max_debt, max_dirs, min_blocks, min_inodes; |
285 | int group = -1, i; | 282 | int group = -1, i; |
286 | struct ext2_group_desc *desc; | 283 | struct ext2_group_desc *desc; |
287 | struct buffer_head *bh; | ||
288 | 284 | ||
289 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); | 285 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); |
290 | avefreei = freei / ngroups; | 286 | avefreei = freei / ngroups; |
@@ -295,7 +291,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
295 | if ((parent == sb->s_root->d_inode) || | 291 | if ((parent == sb->s_root->d_inode) || |
296 | (EXT2_I(parent)->i_flags & EXT2_TOPDIR_FL)) { | 292 | (EXT2_I(parent)->i_flags & EXT2_TOPDIR_FL)) { |
297 | struct ext2_group_desc *best_desc = NULL; | 293 | struct ext2_group_desc *best_desc = NULL; |
298 | struct buffer_head *best_bh = NULL; | ||
299 | int best_ndir = inodes_per_group; | 294 | int best_ndir = inodes_per_group; |
300 | int best_group = -1; | 295 | int best_group = -1; |
301 | 296 | ||
@@ -303,7 +298,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
303 | parent_group = (unsigned)group % ngroups; | 298 | parent_group = (unsigned)group % ngroups; |
304 | for (i = 0; i < ngroups; i++) { | 299 | for (i = 0; i < ngroups; i++) { |
305 | group = (parent_group + i) % ngroups; | 300 | group = (parent_group + i) % ngroups; |
306 | desc = ext2_get_group_desc (sb, group, &bh); | 301 | desc = ext2_get_group_desc (sb, group, NULL); |
307 | if (!desc || !desc->bg_free_inodes_count) | 302 | if (!desc || !desc->bg_free_inodes_count) |
308 | continue; | 303 | continue; |
309 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) | 304 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) |
@@ -315,11 +310,9 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
315 | best_group = group; | 310 | best_group = group; |
316 | best_ndir = le16_to_cpu(desc->bg_used_dirs_count); | 311 | best_ndir = le16_to_cpu(desc->bg_used_dirs_count); |
317 | best_desc = desc; | 312 | best_desc = desc; |
318 | best_bh = bh; | ||
319 | } | 313 | } |
320 | if (best_group >= 0) { | 314 | if (best_group >= 0) { |
321 | desc = best_desc; | 315 | desc = best_desc; |
322 | bh = best_bh; | ||
323 | group = best_group; | 316 | group = best_group; |
324 | goto found; | 317 | goto found; |
325 | } | 318 | } |
@@ -345,7 +338,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
345 | 338 | ||
346 | for (i = 0; i < ngroups; i++) { | 339 | for (i = 0; i < ngroups; i++) { |
347 | group = (parent_group + i) % ngroups; | 340 | group = (parent_group + i) % ngroups; |
348 | desc = ext2_get_group_desc (sb, group, &bh); | 341 | desc = ext2_get_group_desc (sb, group, NULL); |
349 | if (!desc || !desc->bg_free_inodes_count) | 342 | if (!desc || !desc->bg_free_inodes_count) |
350 | continue; | 343 | continue; |
351 | if (sbi->s_debts[group] >= max_debt) | 344 | if (sbi->s_debts[group] >= max_debt) |
@@ -362,7 +355,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
362 | fallback: | 355 | fallback: |
363 | for (i = 0; i < ngroups; i++) { | 356 | for (i = 0; i < ngroups; i++) { |
364 | group = (parent_group + i) % ngroups; | 357 | group = (parent_group + i) % ngroups; |
365 | desc = ext2_get_group_desc (sb, group, &bh); | 358 | desc = ext2_get_group_desc (sb, group, NULL); |
366 | if (!desc || !desc->bg_free_inodes_count) | 359 | if (!desc || !desc->bg_free_inodes_count) |
367 | continue; | 360 | continue; |
368 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) | 361 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) |
@@ -389,14 +382,13 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
389 | int parent_group = EXT2_I(parent)->i_block_group; | 382 | int parent_group = EXT2_I(parent)->i_block_group; |
390 | int ngroups = EXT2_SB(sb)->s_groups_count; | 383 | int ngroups = EXT2_SB(sb)->s_groups_count; |
391 | struct ext2_group_desc *desc; | 384 | struct ext2_group_desc *desc; |
392 | struct buffer_head *bh; | ||
393 | int group, i; | 385 | int group, i; |
394 | 386 | ||
395 | /* | 387 | /* |
396 | * Try to place the inode in its parent directory | 388 | * Try to place the inode in its parent directory |
397 | */ | 389 | */ |
398 | group = parent_group; | 390 | group = parent_group; |
399 | desc = ext2_get_group_desc (sb, group, &bh); | 391 | desc = ext2_get_group_desc (sb, group, NULL); |
400 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 392 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
401 | le16_to_cpu(desc->bg_free_blocks_count)) | 393 | le16_to_cpu(desc->bg_free_blocks_count)) |
402 | goto found; | 394 | goto found; |
@@ -420,7 +412,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
420 | group += i; | 412 | group += i; |
421 | if (group >= ngroups) | 413 | if (group >= ngroups) |
422 | group -= ngroups; | 414 | group -= ngroups; |
423 | desc = ext2_get_group_desc (sb, group, &bh); | 415 | desc = ext2_get_group_desc (sb, group, NULL); |
424 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 416 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
425 | le16_to_cpu(desc->bg_free_blocks_count)) | 417 | le16_to_cpu(desc->bg_free_blocks_count)) |
426 | goto found; | 418 | goto found; |
@@ -434,7 +426,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
434 | for (i = 0; i < ngroups; i++) { | 426 | for (i = 0; i < ngroups; i++) { |
435 | if (++group >= ngroups) | 427 | if (++group >= ngroups) |
436 | group = 0; | 428 | group = 0; |
437 | desc = ext2_get_group_desc (sb, group, &bh); | 429 | desc = ext2_get_group_desc (sb, group, NULL); |
438 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) | 430 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) |
439 | goto found; | 431 | goto found; |
440 | } | 432 | } |
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c index 1b102a1ccebb..84818176fd9d 100644 --- a/fs/ext2/inode.c +++ b/fs/ext2/inode.c | |||
@@ -1028,7 +1028,7 @@ static struct ext2_inode *ext2_get_inode(struct super_block *sb, ino_t ino, | |||
1028 | goto Einval; | 1028 | goto Einval; |
1029 | 1029 | ||
1030 | block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb); | 1030 | block_group = (ino - 1) / EXT2_INODES_PER_GROUP(sb); |
1031 | gdp = ext2_get_group_desc(sb, block_group, &bh); | 1031 | gdp = ext2_get_group_desc(sb, block_group, NULL); |
1032 | if (!gdp) | 1032 | if (!gdp) |
1033 | goto Egdp; | 1033 | goto Egdp; |
1034 | /* | 1034 | /* |
diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c index e45dbd651736..1bc8cd89c51d 100644 --- a/fs/ext3/ialloc.c +++ b/fs/ext3/ialloc.c | |||
@@ -204,14 +204,13 @@ static int find_group_dir(struct super_block *sb, struct inode *parent) | |||
204 | int ngroups = EXT3_SB(sb)->s_groups_count; | 204 | int ngroups = EXT3_SB(sb)->s_groups_count; |
205 | unsigned int freei, avefreei; | 205 | unsigned int freei, avefreei; |
206 | struct ext3_group_desc *desc, *best_desc = NULL; | 206 | struct ext3_group_desc *desc, *best_desc = NULL; |
207 | struct buffer_head *bh; | ||
208 | int group, best_group = -1; | 207 | int group, best_group = -1; |
209 | 208 | ||
210 | freei = percpu_counter_read_positive(&EXT3_SB(sb)->s_freeinodes_counter); | 209 | freei = percpu_counter_read_positive(&EXT3_SB(sb)->s_freeinodes_counter); |
211 | avefreei = freei / ngroups; | 210 | avefreei = freei / ngroups; |
212 | 211 | ||
213 | for (group = 0; group < ngroups; group++) { | 212 | for (group = 0; group < ngroups; group++) { |
214 | desc = ext3_get_group_desc (sb, group, &bh); | 213 | desc = ext3_get_group_desc (sb, group, NULL); |
215 | if (!desc || !desc->bg_free_inodes_count) | 214 | if (!desc || !desc->bg_free_inodes_count) |
216 | continue; | 215 | continue; |
217 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) | 216 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) |
@@ -269,7 +268,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
269 | ext3_grpblk_t min_blocks; | 268 | ext3_grpblk_t min_blocks; |
270 | int group = -1, i; | 269 | int group = -1, i; |
271 | struct ext3_group_desc *desc; | 270 | struct ext3_group_desc *desc; |
272 | struct buffer_head *bh; | ||
273 | 271 | ||
274 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); | 272 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); |
275 | avefreei = freei / ngroups; | 273 | avefreei = freei / ngroups; |
@@ -286,7 +284,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
286 | parent_group = (unsigned)group % ngroups; | 284 | parent_group = (unsigned)group % ngroups; |
287 | for (i = 0; i < ngroups; i++) { | 285 | for (i = 0; i < ngroups; i++) { |
288 | group = (parent_group + i) % ngroups; | 286 | group = (parent_group + i) % ngroups; |
289 | desc = ext3_get_group_desc (sb, group, &bh); | 287 | desc = ext3_get_group_desc (sb, group, NULL); |
290 | if (!desc || !desc->bg_free_inodes_count) | 288 | if (!desc || !desc->bg_free_inodes_count) |
291 | continue; | 289 | continue; |
292 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) | 290 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) |
@@ -319,7 +317,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
319 | 317 | ||
320 | for (i = 0; i < ngroups; i++) { | 318 | for (i = 0; i < ngroups; i++) { |
321 | group = (parent_group + i) % ngroups; | 319 | group = (parent_group + i) % ngroups; |
322 | desc = ext3_get_group_desc (sb, group, &bh); | 320 | desc = ext3_get_group_desc (sb, group, NULL); |
323 | if (!desc || !desc->bg_free_inodes_count) | 321 | if (!desc || !desc->bg_free_inodes_count) |
324 | continue; | 322 | continue; |
325 | if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs) | 323 | if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs) |
@@ -334,7 +332,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
334 | fallback: | 332 | fallback: |
335 | for (i = 0; i < ngroups; i++) { | 333 | for (i = 0; i < ngroups; i++) { |
336 | group = (parent_group + i) % ngroups; | 334 | group = (parent_group + i) % ngroups; |
337 | desc = ext3_get_group_desc (sb, group, &bh); | 335 | desc = ext3_get_group_desc (sb, group, NULL); |
338 | if (!desc || !desc->bg_free_inodes_count) | 336 | if (!desc || !desc->bg_free_inodes_count) |
339 | continue; | 337 | continue; |
340 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) | 338 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) |
@@ -358,14 +356,13 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
358 | int parent_group = EXT3_I(parent)->i_block_group; | 356 | int parent_group = EXT3_I(parent)->i_block_group; |
359 | int ngroups = EXT3_SB(sb)->s_groups_count; | 357 | int ngroups = EXT3_SB(sb)->s_groups_count; |
360 | struct ext3_group_desc *desc; | 358 | struct ext3_group_desc *desc; |
361 | struct buffer_head *bh; | ||
362 | int group, i; | 359 | int group, i; |
363 | 360 | ||
364 | /* | 361 | /* |
365 | * Try to place the inode in its parent directory | 362 | * Try to place the inode in its parent directory |
366 | */ | 363 | */ |
367 | group = parent_group; | 364 | group = parent_group; |
368 | desc = ext3_get_group_desc (sb, group, &bh); | 365 | desc = ext3_get_group_desc (sb, group, NULL); |
369 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 366 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
370 | le16_to_cpu(desc->bg_free_blocks_count)) | 367 | le16_to_cpu(desc->bg_free_blocks_count)) |
371 | return group; | 368 | return group; |
@@ -389,7 +386,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
389 | group += i; | 386 | group += i; |
390 | if (group >= ngroups) | 387 | if (group >= ngroups) |
391 | group -= ngroups; | 388 | group -= ngroups; |
392 | desc = ext3_get_group_desc (sb, group, &bh); | 389 | desc = ext3_get_group_desc (sb, group, NULL); |
393 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 390 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
394 | le16_to_cpu(desc->bg_free_blocks_count)) | 391 | le16_to_cpu(desc->bg_free_blocks_count)) |
395 | return group; | 392 | return group; |
@@ -403,7 +400,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
403 | for (i = 0; i < ngroups; i++) { | 400 | for (i = 0; i < ngroups; i++) { |
404 | if (++group >= ngroups) | 401 | if (++group >= ngroups) |
405 | group = 0; | 402 | group = 0; |
406 | desc = ext3_get_group_desc (sb, group, &bh); | 403 | desc = ext3_get_group_desc (sb, group, NULL); |
407 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) | 404 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) |
408 | return group; | 405 | return group; |
409 | } | 406 | } |
diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index 427f83066a0d..d0c7793d9393 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c | |||
@@ -204,14 +204,13 @@ static int find_group_dir(struct super_block *sb, struct inode *parent) | |||
204 | int ngroups = EXT4_SB(sb)->s_groups_count; | 204 | int ngroups = EXT4_SB(sb)->s_groups_count; |
205 | unsigned int freei, avefreei; | 205 | unsigned int freei, avefreei; |
206 | struct ext4_group_desc *desc, *best_desc = NULL; | 206 | struct ext4_group_desc *desc, *best_desc = NULL; |
207 | struct buffer_head *bh; | ||
208 | int group, best_group = -1; | 207 | int group, best_group = -1; |
209 | 208 | ||
210 | freei = percpu_counter_read_positive(&EXT4_SB(sb)->s_freeinodes_counter); | 209 | freei = percpu_counter_read_positive(&EXT4_SB(sb)->s_freeinodes_counter); |
211 | avefreei = freei / ngroups; | 210 | avefreei = freei / ngroups; |
212 | 211 | ||
213 | for (group = 0; group < ngroups; group++) { | 212 | for (group = 0; group < ngroups; group++) { |
214 | desc = ext4_get_group_desc (sb, group, &bh); | 213 | desc = ext4_get_group_desc (sb, group, NULL); |
215 | if (!desc || !desc->bg_free_inodes_count) | 214 | if (!desc || !desc->bg_free_inodes_count) |
216 | continue; | 215 | continue; |
217 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) | 216 | if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) |
@@ -269,7 +268,6 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
269 | ext4_grpblk_t min_blocks; | 268 | ext4_grpblk_t min_blocks; |
270 | int group = -1, i; | 269 | int group = -1, i; |
271 | struct ext4_group_desc *desc; | 270 | struct ext4_group_desc *desc; |
272 | struct buffer_head *bh; | ||
273 | 271 | ||
274 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); | 272 | freei = percpu_counter_read_positive(&sbi->s_freeinodes_counter); |
275 | avefreei = freei / ngroups; | 273 | avefreei = freei / ngroups; |
@@ -287,7 +285,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
287 | parent_group = (unsigned)group % ngroups; | 285 | parent_group = (unsigned)group % ngroups; |
288 | for (i = 0; i < ngroups; i++) { | 286 | for (i = 0; i < ngroups; i++) { |
289 | group = (parent_group + i) % ngroups; | 287 | group = (parent_group + i) % ngroups; |
290 | desc = ext4_get_group_desc (sb, group, &bh); | 288 | desc = ext4_get_group_desc (sb, group, NULL); |
291 | if (!desc || !desc->bg_free_inodes_count) | 289 | if (!desc || !desc->bg_free_inodes_count) |
292 | continue; | 290 | continue; |
293 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) | 291 | if (le16_to_cpu(desc->bg_used_dirs_count) >= best_ndir) |
@@ -322,7 +320,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
322 | 320 | ||
323 | for (i = 0; i < ngroups; i++) { | 321 | for (i = 0; i < ngroups; i++) { |
324 | group = (parent_group + i) % ngroups; | 322 | group = (parent_group + i) % ngroups; |
325 | desc = ext4_get_group_desc (sb, group, &bh); | 323 | desc = ext4_get_group_desc (sb, group, NULL); |
326 | if (!desc || !desc->bg_free_inodes_count) | 324 | if (!desc || !desc->bg_free_inodes_count) |
327 | continue; | 325 | continue; |
328 | if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs) | 326 | if (le16_to_cpu(desc->bg_used_dirs_count) >= max_dirs) |
@@ -337,7 +335,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent) | |||
337 | fallback: | 335 | fallback: |
338 | for (i = 0; i < ngroups; i++) { | 336 | for (i = 0; i < ngroups; i++) { |
339 | group = (parent_group + i) % ngroups; | 337 | group = (parent_group + i) % ngroups; |
340 | desc = ext4_get_group_desc (sb, group, &bh); | 338 | desc = ext4_get_group_desc (sb, group, NULL); |
341 | if (!desc || !desc->bg_free_inodes_count) | 339 | if (!desc || !desc->bg_free_inodes_count) |
342 | continue; | 340 | continue; |
343 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) | 341 | if (le16_to_cpu(desc->bg_free_inodes_count) >= avefreei) |
@@ -361,14 +359,13 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
361 | int parent_group = EXT4_I(parent)->i_block_group; | 359 | int parent_group = EXT4_I(parent)->i_block_group; |
362 | int ngroups = EXT4_SB(sb)->s_groups_count; | 360 | int ngroups = EXT4_SB(sb)->s_groups_count; |
363 | struct ext4_group_desc *desc; | 361 | struct ext4_group_desc *desc; |
364 | struct buffer_head *bh; | ||
365 | int group, i; | 362 | int group, i; |
366 | 363 | ||
367 | /* | 364 | /* |
368 | * Try to place the inode in its parent directory | 365 | * Try to place the inode in its parent directory |
369 | */ | 366 | */ |
370 | group = parent_group; | 367 | group = parent_group; |
371 | desc = ext4_get_group_desc (sb, group, &bh); | 368 | desc = ext4_get_group_desc (sb, group, NULL); |
372 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 369 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
373 | le16_to_cpu(desc->bg_free_blocks_count)) | 370 | le16_to_cpu(desc->bg_free_blocks_count)) |
374 | return group; | 371 | return group; |
@@ -392,7 +389,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
392 | group += i; | 389 | group += i; |
393 | if (group >= ngroups) | 390 | if (group >= ngroups) |
394 | group -= ngroups; | 391 | group -= ngroups; |
395 | desc = ext4_get_group_desc (sb, group, &bh); | 392 | desc = ext4_get_group_desc (sb, group, NULL); |
396 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && | 393 | if (desc && le16_to_cpu(desc->bg_free_inodes_count) && |
397 | le16_to_cpu(desc->bg_free_blocks_count)) | 394 | le16_to_cpu(desc->bg_free_blocks_count)) |
398 | return group; | 395 | return group; |
@@ -406,7 +403,7 @@ static int find_group_other(struct super_block *sb, struct inode *parent) | |||
406 | for (i = 0; i < ngroups; i++) { | 403 | for (i = 0; i < ngroups; i++) { |
407 | if (++group >= ngroups) | 404 | if (++group >= ngroups) |
408 | group = 0; | 405 | group = 0; |
409 | desc = ext4_get_group_desc (sb, group, &bh); | 406 | desc = ext4_get_group_desc (sb, group, NULL); |
410 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) | 407 | if (desc && le16_to_cpu(desc->bg_free_inodes_count)) |
411 | return group; | 408 | return group; |
412 | } | 409 | } |