Skip to content

Commit 81a4e32

Browse files
namhyungjankara
authored andcommitted
ext3: Use DIV_ROUND_UP() on group desc block counting
Signed-off-by: Namhyung Kim <namhyung@gmail.com> Signed-off-by: Jan Kara <jack@suse.cz>
1 parent 4569cd1 commit 81a4e32

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎fs/ext3/super.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1864,8 +1864,7 @@ static int ext3_fill_super (struct super_block *sb, void *data, int silent)
18641864
sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) -
18651865
le32_to_cpu(es->s_first_data_block) - 1)
18661866
/ EXT3_BLOCKS_PER_GROUP(sb)) + 1;
1867-
db_count = (sbi->s_groups_count + EXT3_DESC_PER_BLOCK(sb) - 1) /
1868-
EXT3_DESC_PER_BLOCK(sb);
1867+
db_count = DIV_ROUND_UP(sbi->s_groups_count, EXT3_DESC_PER_BLOCK(sb));
18691868
sbi->s_group_desc = kmalloc(db_count * sizeof (struct buffer_head *),
18701869
GFP_KERNEL);
18711870
if (sbi->s_group_desc == NULL) {

0 commit comments

Comments
 (0)