diff options
| author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 01:41:15 +0000 |
|---|---|---|
| committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-04-26 01:41:15 +0000 |
| commit | ee7ae58a459456663a2665993e954aedbfb64453 (patch) | |
| tree | 1f2a59c9cfe8a91cd77930e2c51b0516e39abc0b /sys | |
| parent | 9f3a915030c102cd28bd208c40d0c236c845435c (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/fs/ext2fs/ext2_vfsops.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/fs/ext2fs/ext2_vfsops.c b/sys/fs/ext2fs/ext2_vfsops.c index a1f3c514b242..9f2b94c1e002 100644 --- a/sys/fs/ext2fs/ext2_vfsops.c +++ b/sys/fs/ext2fs/ext2_vfsops.c @@ -357,10 +357,10 @@ compute_sb_data(struct vnode *devvp, struct ext2fs *es, fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs); fs->e2fs_itpg = fs->e2fs_ipg / fs->e2fs_ipb; /* s_resuid / s_resgid ? */ - fs->e2fs_gcount = (es->e2fs_bcount - es->e2fs_first_dblock + - EXT2_BLOCKS_PER_GROUP(fs) - 1) / EXT2_BLOCKS_PER_GROUP(fs); + fs->e2fs_gcount = howmany(es->e2fs_bcount - es->e2fs_first_dblock, + EXT2_BLOCKS_PER_GROUP(fs)); e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd); - db_count = (fs->e2fs_gcount + e2fs_descpb - 1) / e2fs_descpb; + db_count = howmany(fs->e2fs_gcount, e2fs_descpb); fs->e2fs_gdbcount = db_count; fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize, M_EXT2MNT, M_WAITOK); @@ -970,7 +970,7 @@ ext2_vget(struct mount *mp, ino_t ino, int flags, struct vnode **vpp) */ if (!(ip->i_flag & IN_E4EXTENTS) && (S_ISDIR(ip->i_mode) || S_ISREG(ip->i_mode))) { - used_blocks = (ip->i_size+fs->e2fs_bsize-1) / fs->e2fs_bsize; + used_blocks = howmany(ip->i_size, fs->e2fs_bsize); for (i = used_blocks; i < EXT2_NDIR_BLOCKS; i++) ip->i_db[i] = 0; } |
