summaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-06-04 23:40:17 +0200
committerMatthew Wilcox (Oracle) <willy@infradead.org>2022-06-29 14:51:06 +0200
commit105c988f5dd76397616e0392ea85d45225397191 (patch)
treec4bb763c306ef5ae48661587386c5a01313aca6b /mm/shmem.c
parentvmscan: Add check_move_unevictable_folios() (diff)
downloadlinux-105c988f5dd76397616e0392ea85d45225397191.tar.xz
linux-105c988f5dd76397616e0392ea85d45225397191.zip
shmem: Convert shmem_unlock_mapping() to use filemap_get_folios()
This is a straightforward conversion. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 6a5e46f1a326..28a62be1d41e 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -867,18 +867,17 @@ unsigned long shmem_swap_usage(struct vm_area_struct *vma)
*/
void shmem_unlock_mapping(struct address_space *mapping)
{
- struct pagevec pvec;
+ struct folio_batch fbatch;
pgoff_t index = 0;
- pagevec_init(&pvec);
+ folio_batch_init(&fbatch);
/*
* Minor point, but we might as well stop if someone else SHM_LOCKs it.
*/
- while (!mapping_unevictable(mapping)) {
- if (!pagevec_lookup(&pvec, mapping, &index))
- break;
- check_move_unevictable_pages(&pvec);
- pagevec_release(&pvec);
+ while (!mapping_unevictable(mapping) &&
+ filemap_get_folios(mapping, &index, ~0UL, &fbatch)) {
+ check_move_unevictable_folios(&fbatch);
+ folio_batch_release(&fbatch);
cond_resched();
}
}