gup: use folios for gup_devmap
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Wed, 24 Apr 2024 19:19:10 +0000 (20:19 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 6 May 2024 00:53:49 +0000 (17:53 -0700)
commit9cbe4954c6d93e6a72680fe634913c0d056fd932
treede67d0405b02b472dc1c8952ae45f9761247d613
parent498aefbc69d5719d8e4713b568122c259167f7b9
gup: use folios for gup_devmap

Use try_grab_folio() instead of try_grab_page() so we get the folio back
that we calculated, and then use folio_set_referenced() instead of
SetPageReferenced().  Correspondingly, use gup_put_folio() to put any
unneeded references.

Link: https://lkml.kernel.org/r/20240424191914.361554-6-willy@infradead.org
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/gup.c