diff options
author | Dave Chinner | 2018-06-08 09:54:22 -0700 |
---|---|---|
committer | Darrick J. Wong | 2018-06-08 10:07:52 -0700 |
commit | 0703a8e1c17e2cba742eafe640be3b60f77352c4 (patch) | |
tree | f52e7880cb8e77ef601a5937b1586271e2389b9b /fs/xfs/xfs_linux.h | |
parent | bb3d48dcf86a97dc25fe9fc2c11938e19cb4399a (diff) |
xfs: replace do_mod with native operations
do_mod() is a hold-over from when we have different sizes for file
offsets and and other internal values for 40 bit XFS filesystems.
Hence depending on build flags variables passed to do_mod() could
change size. We no longer support those small format filesystems and
hence everything is of fixed size theses days, even on 32 bit
platforms.
As such, we can convert all the do_mod() callers to platform
optimised modulus operations as defined by linux/math64.h.
Individual conversions depend on the types of variables being used.
Signed-Off-By: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_linux.h')
-rw-r--r-- | fs/xfs/xfs_linux.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/fs/xfs/xfs_linux.h b/fs/xfs/xfs_linux.h index 0fcb6295aa5d..edbd5a210df2 100644 --- a/fs/xfs/xfs_linux.h +++ b/fs/xfs/xfs_linux.h @@ -207,25 +207,6 @@ static inline xfs_dev_t linux_to_xfs_dev_t(dev_t dev) #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) #define xfs_stack_trace() dump_stack() -/* Side effect free 64 bit mod operation */ -static inline __u32 xfs_do_mod(void *a, __u32 b, int n) -{ - switch (n) { - case 4: - return *(__u32 *)a % b; - case 8: - { - __u64 c = *(__u64 *)a; - return do_div(c, b); - } - } - - /* NOTREACHED */ - return 0; -} - -#define do_mod(a, b) xfs_do_mod(&(a), (b), sizeof(a)) - static inline uint64_t roundup_64(uint64_t x, uint32_t y) { x += y - 1; |