]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
powerpc/mm: Refactor the floor/ceiling check in hugetlb range freeing functions
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Fri, 6 Nov 2020 13:20:54 +0000 (13:20 +0000)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 9 Dec 2020 12:48:14 +0000 (23:48 +1100)
commit7bfe54b5f16561bb703de6482f880614ada8dbf2
tree7ab5ddc8602b77cfca30f73a6bedf3edc8932c50
parent5f1888a077069988218805534f56b983b6d5710c
powerpc/mm: Refactor the floor/ceiling check in hugetlb range freeing functions

All hugetlb range freeing functions have a verification like the following,
which only differs by the mask used, depending on the page table level.

start &= MASK;
if (start < floor)
return;
if (ceiling) {
ceiling &= MASK;
if (! ceiling)
return;
}
if (end - 1 > ceiling - 1)
return;

Refactor that into a helper function which takes the mask as
an argument, returning true when [start;end[ is not fully
contained inside [floor;ceiling[

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/16a571bb32eb6e8cd44bda484c8d81cd8a25e6d7.1604668827.git.christophe.leroy@csgroup.eu
arch/powerpc/mm/hugetlbpage.c