diff options
author | Eric Sandeen <sandeen@redhat.com> | 2017-04-07 01:01:47 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-04-12 17:42:51 +0200 |
commit | d956f813b6e731ef82699a18e468e37d59a1366d (patch) | |
tree | b5264ed9414904690636a7c411e76ebb9a1488b5 | |
parent | xfs: actually report xattr extents via iomap (diff) | |
download | linux-d956f813b6e731ef82699a18e468e37d59a1366d.tar.xz linux-d956f813b6e731ef82699a18e468e37d59a1366d.zip |
xfs: simplify xfs_calc_dquots_per_chunk
ndquots is a 32-bit value, and we don't care
about the remainder; there is no reason to use do_div
here, it seems to be the result of a decade+ historical
accident.
Worse, the do_div implementation in userspace breaks
when fed a 32-bit dividend, so we commented it out there
in any case.
Change to simple division, and then we can change
userspace to match, and mandate a 64-bit dividend in
the do_div() in userspace as well.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
-rw-r--r-- | fs/xfs/libxfs/xfs_dquot_buf.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_dquot_buf.c b/fs/xfs/libxfs/xfs_dquot_buf.c index ac9a003dd29a..747085b4ef44 100644 --- a/fs/xfs/libxfs/xfs_dquot_buf.c +++ b/fs/xfs/libxfs/xfs_dquot_buf.c @@ -35,13 +35,8 @@ int xfs_calc_dquots_per_chunk( unsigned int nbblks) /* basic block units */ { - unsigned int ndquots; - ASSERT(nbblks > 0); - ndquots = BBTOB(nbblks); - do_div(ndquots, sizeof(xfs_dqblk_t)); - - return ndquots; + return BBTOB(nbblks) / sizeof(xfs_dqblk_t); } /* |