Commit 68c3271515f11f6665dc8732e53aaab3d3fdd7d3

Authored by Nathan Scott
Committed by Tim Shimmin
1 parent d432c80e68

[XFS] Fix a porting botch on the realtime subvol growfs code path.

SGI-PV: 955515
SGI-Modid: xfs-linux-melb:xfs-kern:26806a

Signed-off-by: Nathan Scott <nathans@sgi.com>
Signed-off-by: Tim Shimmin <tes@sgi.com>

Showing 2 changed files with 8 additions and 1 deletions Side-by-side Diff

fs/xfs/linux-2.6/xfs_linux.h
... ... @@ -332,5 +332,12 @@
332 332 return(x * y);
333 333 }
334 334  
  335 +static 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 342 #endif /* __XFS_LINUX__ */
fs/xfs/xfs_rtalloc.c
... ... @@ -1948,7 +1948,7 @@
1948 1948 */
1949 1949 nrextents = nrblocks;
1950 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 1952 nrextslog = xfs_highbit32(nrextents);
1953 1953 nrsumlevels = nrextslog + 1;
1954 1954 nrsumsize = (uint)sizeof(xfs_suminfo_t) * nrsumlevels * nrbmblocks;