From: James Simmons Date: Mon, 30 Mar 2020 17:06:19 +0000 (-0400) Subject: LU-6174 lod: remove incorrect ll_do_div64 X-Git-Tag: 2.13.54~242 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=12ed98d4ef294b78393bc9acb2aefd570b263855 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 --- 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;