aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/linux-2.6/xfs_linux.h7
-rw-r--r--fs/xfs/xfs_rtalloc.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h
index 14d840208e81..2b0e0018738a 100644
--- a/fs/xfs/linux-2.6/xfs_linux.h
+++ b/fs/xfs/linux-2.6/xfs_linux.h
@@ -332,4 +332,11 @@ static inline __uint64_t roundup_64(__uint64_t x, __uint32_t y)
332 return(x * y); 332 return(x * y);
333} 333}
334 334
335static inline __uint64_t howmany_64(__uint64_t x, __uint32_t y)
336{
337 x += y - 1;
338 do_div(x, y);
339 return x;
340}
341
335#endif /* __XFS_LINUX__ */ 342#endif /* __XFS_LINUX__ */
diff --git a/fs/xfs/xfs_rtalloc.c b/fs/xfs/xfs_rtalloc.c
index e050987afe18..880c73271c05 100644
--- a/fs/xfs/xfs_rtalloc.c
+++ b/fs/xfs/xfs_rtalloc.c
@@ -1948,7 +1948,7 @@ xfs_growfs_rt(
1948 */ 1948 */
1949 nrextents = nrblocks; 1949 nrextents = nrblocks;
1950 do_div(nrextents, in->extsize); 1950 do_div(nrextents, in->extsize);
1951 nrbmblocks = roundup_64(nrextents, NBBY * sbp->sb_blocksize); 1951 nrbmblocks = howmany_64(nrextents, NBBY * sbp->sb_blocksize);
1952 nrextslog = xfs_highbit32(nrextents); 1952 nrextslog = xfs_highbit32(nrextents);
1953 nrsumlevels = nrextslog + 1; 1953 nrsumlevels = nrextslog + 1;
1954 nrsumsize = (uint)sizeof(xfs_suminfo_t) * nrsumlevels * nrbmblocks; 1954 nrsumsize = (uint)sizeof(xfs_suminfo_t) * nrsumlevels * nrbmblocks;