]> www.infradead.org Git - users/dwmw2/linux.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>
Thu, 7 Nov 2024 04:11:10 +0000 (20:11 -0800)
commitbd40b053fabe27209cb240d205a0c817cbe5fb87
treef642ad79ff45513e4ae7c9494c0889c3ad1eb8f4
parent5b2f650d593ed4d020228df8563e7ad23abc847f
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.

[akpm@linux-foundation.org: remove now-unused local]
Link: https://lore.kernel.org/oe-kbuild-all/202410081210.uNLbf3Jk-lkp@intel.com/
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