Whamcloud - gitweb
LU-6174 lov: use standard Linux 64 divison macros 43/39343/12
authorJames Simmons <jsimmons@infradead.org>
Wed, 13 Sep 2023 16:24:12 +0000 (12:24 -0400)
committerOleg Drokin <green@whamcloud.com>
Wed, 25 Oct 2023 18:02:07 +0000 (18:02 +0000)
commit6eee4ea5b63e592eb3eb0cc5a91f787226a863e2
tree76cce2369d444a421804ddb59968933af9184adf
parent40ce52f02cf964327440804abb5da31f750476eb
LU-6174 lov: use standard Linux 64 divison macros

For the case of 64 bit platforms lov_do_div64() is basically the
same as div_u64_rem(). For the 32 bit platform case lustre tries
to work around the issue of the divisor being larger than 32 bits.
We can also use div64_u64_rem() as well for 32 bit platforms since
Linux supports that as well.

With the move to Linux div64 operations we need to migrate fields
related to 64 bit size fields. To pick the correct div64 function
we need to select the proper sign value. The lov layer often uses
loff_t, which is signed, for stripe sizes which doesn't make sense
since sizes should always be positive. Creating a negative size by
mistake will give an bizarre offset into a file. Avoid any potential
issues with signed vs unsigned issues by replacing the loff_t use
in this case with u64.

Test-Parameters: testlist=large-lun env=ONLY=5,REFORMAT=yes
Change-Id: Ieadc266d43d6be1d6d47ee14ba9ac0dab01e7d86
Signed-off-by: James Simmons <jsimmons@infradead.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/39343
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lov/lov_internal.h
lustre/lov/lov_io.c
lustre/lov/lov_offset.c
lustre/lov/lov_request.c
lustre/tests/large-lun.sh
lustre/tests/sanity-pfl.sh [changed mode: 0644->0755]