diff options
Diffstat (limited to 'fs/ext3/balloc.c')
-rw-r--r-- | fs/ext3/balloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index e463dca008e4..0213db4911a2 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -1410,7 +1410,7 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) | |||
1410 | unsigned long desc_count; | 1410 | unsigned long desc_count; |
1411 | struct ext3_group_desc *gdp; | 1411 | struct ext3_group_desc *gdp; |
1412 | int i; | 1412 | int i; |
1413 | unsigned long ngroups; | 1413 | unsigned long ngroups = EXT3_SB(sb)->s_groups_count; |
1414 | #ifdef EXT3FS_DEBUG | 1414 | #ifdef EXT3FS_DEBUG |
1415 | struct ext3_super_block *es; | 1415 | struct ext3_super_block *es; |
1416 | unsigned long bitmap_count, x; | 1416 | unsigned long bitmap_count, x; |
@@ -1421,7 +1421,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) | |||
1421 | desc_count = 0; | 1421 | desc_count = 0; |
1422 | bitmap_count = 0; | 1422 | bitmap_count = 0; |
1423 | gdp = NULL; | 1423 | gdp = NULL; |
1424 | for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++) { | 1424 | |
1425 | for (i = 0; i < ngroups; i++) { | ||
1425 | gdp = ext3_get_group_desc(sb, i, NULL); | 1426 | gdp = ext3_get_group_desc(sb, i, NULL); |
1426 | if (!gdp) | 1427 | if (!gdp) |
1427 | continue; | 1428 | continue; |
@@ -1443,7 +1444,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) | |||
1443 | return bitmap_count; | 1444 | return bitmap_count; |
1444 | #else | 1445 | #else |
1445 | desc_count = 0; | 1446 | desc_count = 0; |
1446 | ngroups = EXT3_SB(sb)->s_groups_count; | ||
1447 | smp_rmb(); | 1447 | smp_rmb(); |
1448 | for (i = 0; i < ngroups; i++) { | 1448 | for (i = 0; i < ngroups; i++) { |
1449 | gdp = ext3_get_group_desc(sb, i, NULL); | 1449 | gdp = ext3_get_group_desc(sb, i, NULL); |