From 3dbca1ca2edf8e2a6b38ba521090a868e610cb4e Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Thu, 28 Sep 2006 11:03:53 +1000 Subject: [PATCH] --- yaml --- r: 37155 b: refs/heads/master c: 68c3271515f11f6665dc8732e53aaab3d3fdd7d3 h: refs/heads/master i: 37153: 7b1653d57cfa9dfd3921ca6cbfa91783d8556533 37151: 3f6e74b4320b464602c1b6fd0e2e7a3d65d1876e v: v3 --- [refs] | 2 +- trunk/fs/xfs/linux-2.6/xfs_linux.h | 7 +++++++ trunk/fs/xfs/xfs_rtalloc.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 63e87630ff84..55a52176c053 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d432c80e68e3c283fc9a85021f5b65e0aabf254e +refs/heads/master: 68c3271515f11f6665dc8732e53aaab3d3fdd7d3 diff --git a/trunk/fs/xfs/linux-2.6/xfs_linux.h b/trunk/fs/xfs/linux-2.6/xfs_linux.h index 14d840208e81..2b0e0018738a 100644 --- a/trunk/fs/xfs/linux-2.6/xfs_linux.h +++ b/trunk/fs/xfs/linux-2.6/xfs_linux.h @@ -332,4 +332,11 @@ static inline __uint64_t roundup_64(__uint64_t x, __uint32_t y) return(x * y); } +static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y) +{ + x += y - 1; + do_div(x, y); + return x; +} + #endif /* __XFS_LINUX__ */ diff --git a/trunk/fs/xfs/xfs_rtalloc.c b/trunk/fs/xfs/xfs_rtalloc.c index e050987afe18..880c73271c05 100644 --- a/trunk/fs/xfs/xfs_rtalloc.c +++ b/trunk/fs/xfs/xfs_rtalloc.c @@ -1948,7 +1948,7 @@ xfs_growfs_rt( */ nrextents = nrblocks; do_div(nrextents, in->extsize); - nrbmblocks = roundup_64(nrextents, NBBY * sbp->sb_blocksize); + nrbmblocks = howmany_64(nrextents, NBBY * sbp->sb_blocksize); nrextslog = xfs_highbit32(nrextents); nrsumlevels = nrextslog + 1; nrsumsize = (uint)sizeof(xfs_suminfo_t) * nrsumlevels * nrbmblocks;