Re: [PATCH 1/2] mm/gup: Remove unnecessary check in memfd_pin_folios()

From: David Hildenbrand
Date: Wed Apr 30 2025 - 17:49:12 EST


On 30.04.25 03:00, Vishal Moola (Oracle) wrote:
Commit 89c1905d9c14 ("mm/gup: introduce memfd_pin_folios() for pinning memfd folios")
checks if filemap_get_folios_contig() returned duplicate folios to
prevent multiple attempts at pinning the same folio.

Commit 8ab1b1602396 ("mm: fix filemap_get_folios_contig returning batches of identical folios")
ensures that filemap_get_folios_contig() returns a batch of distinct folios.

We can remove the duplicate folio check to simplify the code and save
58 bytes of text.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@xxxxxxxxx>
---

Acked-by: David Hildenbrand <david@xxxxxxxxxx>

--
Cheers,

David / dhildenb