]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ext3: Use DIV_ROUND_UP() on group desc block counting
authorNamhyung Kim <namhyung@gmail.com>
Mon, 11 Oct 2010 10:38:39 +0000 (19:38 +0900)
committerJan Kara <jack@suse.cz>
Wed, 27 Oct 2010 23:30:04 +0000 (01:30 +0200)
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext3/super.c

index 1811c6fd5ba4b7d6f21d52d67a54fd503f46c899..1c6875118b1e3e0557aa6cdf818d0a71dd3a2bb6 100644 (file)
@@ -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) {