diff options
Diffstat (limited to 'fs/ext3/balloc.c')
-rw-r--r-- | fs/ext3/balloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c index 0213db4911a2..7992d21e0e09 100644 --- a/fs/ext3/balloc.c +++ b/fs/ext3/balloc.c | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <linux/quotaops.h> | 20 | #include <linux/quotaops.h> |
21 | #include <linux/buffer_head.h> | 21 | #include <linux/buffer_head.h> |
22 | 22 | ||
23 | #include "bitmap.h" | ||
24 | |||
23 | /* | 25 | /* |
24 | * balloc.c contains the blocks allocation and deallocation routines | 26 | * balloc.c contains the blocks allocation and deallocation routines |
25 | */ | 27 | */ |
@@ -1010,7 +1012,7 @@ retry: | |||
1010 | * allocation within the reservation window. | 1012 | * allocation within the reservation window. |
1011 | * | 1013 | * |
1012 | * This will avoid keeping on searching the reservation list again and | 1014 | * This will avoid keeping on searching the reservation list again and |
1013 | * again when someboday is looking for a free block (without | 1015 | * again when somebody is looking for a free block (without |
1014 | * reservation), and there are lots of free blocks, but they are all | 1016 | * reservation), and there are lots of free blocks, but they are all |
1015 | * being reserved. | 1017 | * being reserved. |
1016 | * | 1018 | * |
@@ -1416,12 +1418,12 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) | |||
1416 | unsigned long bitmap_count, x; | 1418 | unsigned long bitmap_count, x; |
1417 | struct buffer_head *bitmap_bh = NULL; | 1419 | struct buffer_head *bitmap_bh = NULL; |
1418 | 1420 | ||
1419 | lock_super(sb); | ||
1420 | es = EXT3_SB(sb)->s_es; | 1421 | es = EXT3_SB(sb)->s_es; |
1421 | desc_count = 0; | 1422 | desc_count = 0; |
1422 | bitmap_count = 0; | 1423 | bitmap_count = 0; |
1423 | gdp = NULL; | 1424 | gdp = NULL; |
1424 | 1425 | ||
1426 | smp_rmb(); | ||
1425 | for (i = 0; i < ngroups; i++) { | 1427 | for (i = 0; i < ngroups; i++) { |
1426 | gdp = ext3_get_group_desc(sb, i, NULL); | 1428 | gdp = ext3_get_group_desc(sb, i, NULL); |
1427 | if (!gdp) | 1429 | if (!gdp) |
@@ -1440,7 +1442,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) | |||
1440 | brelse(bitmap_bh); | 1442 | brelse(bitmap_bh); |
1441 | printk("ext3_count_free_blocks: stored = %u, computed = %lu, %lu\n", | 1443 | printk("ext3_count_free_blocks: stored = %u, computed = %lu, %lu\n", |
1442 | le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count); | 1444 | le32_to_cpu(es->s_free_blocks_count), desc_count, bitmap_count); |
1443 | unlock_super(sb); | ||
1444 | return bitmap_count; | 1445 | return bitmap_count; |
1445 | #else | 1446 | #else |
1446 | desc_count = 0; | 1447 | desc_count = 0; |