提交 8bdac5d1 编写于 作者: G Glauber de Oliveira Costa 提交者: Linus Torvalds

[PATCH] ext3: EXT3_DEBUG build fixes

Fix some warnings and a build error when EXT3_DEBUG is enabled.
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 f65d9bea
...@@ -1410,7 +1410,7 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) ...@@ -1410,7 +1410,7 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
unsigned long desc_count; unsigned long desc_count;
struct ext3_group_desc *gdp; struct ext3_group_desc *gdp;
int i; int i;
unsigned long ngroups; unsigned long ngroups = EXT3_SB(sb)->s_groups_count;
#ifdef EXT3FS_DEBUG #ifdef EXT3FS_DEBUG
struct ext3_super_block *es; struct ext3_super_block *es;
unsigned long bitmap_count, x; unsigned long bitmap_count, x;
...@@ -1421,7 +1421,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) ...@@ -1421,7 +1421,8 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
desc_count = 0; desc_count = 0;
bitmap_count = 0; bitmap_count = 0;
gdp = NULL; gdp = NULL;
for (i = 0; i < EXT3_SB(sb)->s_groups_count; i++) {
for (i = 0; i < ngroups; i++) {
gdp = ext3_get_group_desc(sb, i, NULL); gdp = ext3_get_group_desc(sb, i, NULL);
if (!gdp) if (!gdp)
continue; continue;
...@@ -1443,7 +1444,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb) ...@@ -1443,7 +1444,6 @@ unsigned long ext3_count_free_blocks(struct super_block *sb)
return bitmap_count; return bitmap_count;
#else #else
desc_count = 0; desc_count = 0;
ngroups = EXT3_SB(sb)->s_groups_count;
smp_rmb(); smp_rmb();
for (i = 0; i < ngroups; i++) { for (i = 0; i < ngroups; i++) {
gdp = ext3_get_group_desc(sb, i, NULL); gdp = ext3_get_group_desc(sb, i, NULL);
......
...@@ -242,7 +242,7 @@ static int setup_new_group_blocks(struct super_block *sb, ...@@ -242,7 +242,7 @@ static int setup_new_group_blocks(struct super_block *sb,
i < sbi->s_itb_per_group; i++, bit++, block++) { i < sbi->s_itb_per_group; i++, bit++, block++) {
struct buffer_head *it; struct buffer_head *it;
ext3_debug("clear inode block %#04x (+%ld)\n", block, bit); ext3_debug("clear inode block %#04lx (+%d)\n", block, bit);
if (IS_ERR(it = bclean(handle, sb, block))) { if (IS_ERR(it = bclean(handle, sb, block))) {
err = PTR_ERR(it); err = PTR_ERR(it);
goto exit_bh; goto exit_bh;
...@@ -643,8 +643,8 @@ static void update_backups(struct super_block *sb, ...@@ -643,8 +643,8 @@ static void update_backups(struct super_block *sb,
break; break;
bh = sb_getblk(sb, group * bpg + blk_off); bh = sb_getblk(sb, group * bpg + blk_off);
ext3_debug(sb, __FUNCTION__, "update metadata backup %#04lx\n", ext3_debug("update metadata backup %#04lx\n",
bh->b_blocknr); (unsigned long)bh->b_blocknr);
if ((err = ext3_journal_get_write_access(handle, bh))) if ((err = ext3_journal_get_write_access(handle, bh)))
break; break;
lock_buffer(bh); lock_buffer(bh);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册