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 <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/38101
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Tested-by: Maloo <maloo@whamcloud.com>
-#define ll_do_div64(aaa,bbb) do_div((aaa), (bbb))
/**
* Size initialization on late striping.
*
/**
* Size initialization on late striping.
*
continue;
LASSERT(objects != NULL && stripe_size != 0);
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;
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;
attr->la_valid = LA_SIZE;
attr->la_size = size;