diff options
author | Dave Kleikamp <dave.kleikamp@oracle.com> | 2012-09-18 12:27:22 -0400 |
---|---|---|
committer | Dave Kleikamp <dave.kleikamp@oracle.com> | 2012-09-18 12:27:22 -0400 |
commit | 84f4141ee3ea11035f741d4298cb6bbad1850fcf (patch) | |
tree | 71a3cef2ad939325000c3a0c0769cafe6d32471a /fs/jfs | |
parent | 550d6da288df57f154ca27c4acb1c398ced42ea9 (diff) |
jfs: Fix do_div precision in commit b40c2e66
In a hasty fix to replace a 64-bit division with do_div, I
unintentionally assigned the divisor to a 32-bit variable.
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Cc: Tino Reichardt <milky-kernel@mcmilk.de>
Diffstat (limited to 'fs/jfs')
-rw-r--r-- | fs/jfs/jfs_dmap.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c index 174feb6a73c..9a55f53be5f 100644 --- a/fs/jfs/jfs_dmap.c +++ b/fs/jfs/jfs_dmap.c | |||
@@ -1641,14 +1641,15 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen) | |||
1641 | 1641 | ||
1642 | /* max blkno / nblocks pairs to trim */ | 1642 | /* max blkno / nblocks pairs to trim */ |
1643 | int count = 0, range_cnt; | 1643 | int count = 0, range_cnt; |
1644 | u64 max_ranges; | ||
1644 | 1645 | ||
1645 | /* prevent others from writing new stuff here, while trimming */ | 1646 | /* prevent others from writing new stuff here, while trimming */ |
1646 | IWRITE_LOCK(ipbmap, RDWRLOCK_DMAP); | 1647 | IWRITE_LOCK(ipbmap, RDWRLOCK_DMAP); |
1647 | 1648 | ||
1648 | nblocks = bmp->db_agfree[agno]; | 1649 | nblocks = bmp->db_agfree[agno]; |
1649 | range_cnt = nblocks; | 1650 | max_ranges = nblocks; |
1650 | do_div(range_cnt, (int)minlen); | 1651 | do_div(max_ranges, minlen); |
1651 | range_cnt = min(range_cnt + 1, 32 * 1024); | 1652 | range_cnt = min_t(u64, max_ranges + 1, 32 * 1024); |
1652 | totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS); | 1653 | totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS); |
1653 | if (totrim == NULL) { | 1654 | if (totrim == NULL) { |
1654 | jfs_error(bmp->db_ipbmap->i_sb, | 1655 | jfs_error(bmp->db_ipbmap->i_sb, |