From: Vishal Moola (Oracle) Date: Wed, 30 Apr 2025 01:00:59 +0000 (-0700) Subject: mm/gup: remove page_folio() in memfd_pin_folios() X-Git-Tag: v6.16-rc1~92^2~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe488d34edc4042f70d62dfd5d640c9fb11fc84e;p=thirdparty%2Flinux.git mm/gup: remove page_folio() in memfd_pin_folios() We can get the folio directly from the folio batch, so remove the unnecessary page_folio() call. Link: https://lkml.kernel.org/r/20250430010059.892632-3-vishal.moola@gmail.com Signed-off-by: Vishal Moola (Oracle) Acked-by: David Hildenbrand Acked-by: Vivek Kasireddy Signed-off-by: Andrew Morton --- diff --git a/mm/gup.c b/mm/gup.c index e6e2a93868509..d3aac58862c04 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -3641,7 +3641,7 @@ long memfd_pin_folios(struct file *memfd, loff_t start, loff_t end, } for (i = 0; i < nr_found; i++) { - folio = page_folio(&fbatch.folios[i]->page); + folio = fbatch.folios[i]; if (try_grab_folio(folio, 1, FOLL_PIN)) { folio_batch_release(&fbatch);