From 12ed98d4ef294b78393bc9acb2aefd570b263855 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Mon, 30 Mar 2020 13:06:19 -0400 Subject: [PATCH] LU-6174 lod: remove incorrect ll_do_div64 ll_do_div64() is just a wrapper around do_div() which is handled incorrectly. do_div() expects a 32 bit value but stripe_count is cast to 64 bits which is incorrect. Instead lets just avoid casting and use do_div() directly. Change-Id: I08601fdf8e9d5fdf26981f073dd602775c12281b Signed-off-by: James Simmons Reviewed-on: https://review.whamcloud.com/38101 Tested-by: jenkins Reviewed-by: Andreas Dilger Reviewed-by: Shaun Tancheff Tested-by: Maloo --- lustre/lod/lod_object.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index d19f91d..e81de8c 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -5235,7 +5235,6 @@ out: EXIT; } -#define ll_do_div64(aaa,bbb) do_div((aaa), (bbb)) /** * Size initialization on late striping. * @@ -5299,14 +5298,13 @@ static int lod_declare_init_size(const struct lu_env *env, continue; LASSERT(objects != NULL && stripe_size != 0); - /* ll_do_div64(a, b) returns a % b, and a = a / b */ - ll_do_div64(size, (__u64)stripe_size); - stripe = ll_do_div64(size, (__u64)stripe_count); + do_div(size, stripe_size); + stripe = do_div(size, stripe_count); LASSERT(objects[stripe] != NULL); size = size * stripe_size; offs = attr->la_size; - size += ll_do_div64(offs, stripe_size); + size += do_div(offs, stripe_size); attr->la_valid = LA_SIZE; attr->la_size = size; -- 1.8.3.1