]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm: consolidate common checks in hugetlb_get_unmapped_area
authorOscar Salvador <osalvador@suse.de>
Mon, 7 Oct 2024 07:50:37 +0000 (09:50 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 1 Nov 2024 04:29:00 +0000 (21:29 -0700)
commitc5e2ff87f786a7cc2f807734f1732158c120d6cb
treeeeaa021a64915097f87cc5a3c39c84b6f606cd3c
parent9669f333e9340b919492665ab1eed5e23d6105a0
mm: consolidate common checks in hugetlb_get_unmapped_area

prepare_hugepage_range() performs almost the same checks for all
architectures that define it, with the exception of mips and loongarch
that also check for overflows.

The rest checks for the addr and len to be properly aligned, so we can
move that to hugetlb_get_unmapped_area() and get rid of a fair amount of
duplicated code.

Link: https://lkml.kernel.org/r/20241007075037.267650-10-osalvador@suse.de
Signed-off-by: Oscar Salvador <osalvador@suse.de>
Cc: David Hildenbrand <david@redhat.com>
Cc: Donet Tom <donettom@linux.ibm.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Peter Xu <peterx@redhat.com>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/loongarch/include/asm/hugetlb.h
arch/mips/include/asm/hugetlb.h
arch/parisc/include/asm/hugetlb.h
arch/s390/include/asm/hugetlb.h
arch/sh/include/asm/hugetlb.h
fs/hugetlbfs/inode.c
include/asm-generic/hugetlb.h