From: Namhyung Kim Date: Mon, 11 Oct 2010 10:38:39 +0000 (+0900) Subject: ext3: Use DIV_ROUND_UP() on group desc block counting X-Git-Tag: v2.6.37-rc1~78^2~9 X-Git-Url: https://bbs.cooldavid.org/git/?p=net-next-2.6.git;a=commitdiff_plain;h=81a4e320e6ee29bde3fe880ab87b2122bc1de88b ext3: Use DIV_ROUND_UP() on group desc block counting Signed-off-by: Namhyung Kim Signed-off-by: Jan Kara --- diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 1811c6fd5ba..1c6875118b1 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c @@ -1864,8 +1864,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent) sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) - le32_to_cpu(es->s_first_data_block) - 1) / EXT3_BLOCKS_PER_GROUP(sb)) + 1; - db_count = (sbi->s_groups_count + EXT3_DESC_PER_BLOCK(sb) - 1) / - EXT3_DESC_PER_BLOCK(sb); + db_count = DIV_ROUND_UP(sbi->s_groups_count, EXT3_DESC_PER_BLOCK(sb)); sbi->s_group_desc = kmalloc(db_count * sizeof (struct buffer_head *), GFP_KERNEL); if (sbi->s_group_desc == NULL) {