mm/hugetlb: convert hugetlb_change_protection() to folios
authorSidhartha Kumar <sidhartha.kumar@oracle.com>
Wed, 28 May 2025 19:20:13 +0000 (15:20 -0400)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 10 Jul 2025 05:41:54 +0000 (22:41 -0700)
commitcdf48aa83279d4369ec6195f716468950c4440ca
tree654af5d92620431fd21a17b76d59ca682ea1537b
parent4a1ff347e44ce45e8a5c15f466574583b019e4f9
mm/hugetlb: convert hugetlb_change_protection() to folios

The for loop inside hugetlb_change_protection() increments by the huge
page size:

psize = huge_page_size(h);
for (; address < end; address += psize)

so we are operating on the head page of the huge pages between address and
end.  We can safely convert the struct page usage to struct folio.

Link: https://lkml.kernel.org/r/20250528192013.91130-1-sidhartha.kumar@oracle.com
Signed-off-by: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Oscar Salvador <osalvador@suse.de>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/hugetlb.c