mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-28 21:33:52 +00:00
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>
This commit is contained in:
parent
77414d195f
commit
105c988f5d
1 changed files with 6 additions and 7 deletions
13
mm/shmem.c
13
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)
|
void shmem_unlock_mapping(struct address_space *mapping)
|
||||||
{
|
{
|
||||||
struct pagevec pvec;
|
struct folio_batch fbatch;
|
||||||
pgoff_t index = 0;
|
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.
|
* Minor point, but we might as well stop if someone else SHM_LOCKs it.
|
||||||
*/
|
*/
|
||||||
while (!mapping_unevictable(mapping)) {
|
while (!mapping_unevictable(mapping) &&
|
||||||
if (!pagevec_lookup(&pvec, mapping, &index))
|
filemap_get_folios(mapping, &index, ~0UL, &fbatch)) {
|
||||||
break;
|
check_move_unevictable_folios(&fbatch);
|
||||||
check_move_unevictable_pages(&pvec);
|
folio_batch_release(&fbatch);
|
||||||
pagevec_release(&pvec);
|
|
||||||
cond_resched();
|
cond_resched();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue