mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
mm: Remove pagevec_remove_exceptionals()
All of its callers now call folio_batch_remove_exceptionals(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: William Kucharski <william.kucharski@oracle.com>
This commit is contained in:
parent
51dcbdac28
commit
1613fac9aa
3 changed files with 15 additions and 19 deletions
|
@ -27,7 +27,6 @@ struct pagevec {
|
||||||
|
|
||||||
void __pagevec_release(struct pagevec *pvec);
|
void __pagevec_release(struct pagevec *pvec);
|
||||||
void __pagevec_lru_add(struct pagevec *pvec);
|
void __pagevec_lru_add(struct pagevec *pvec);
|
||||||
void pagevec_remove_exceptionals(struct pagevec *pvec);
|
|
||||||
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
unsigned pagevec_lookup_range(struct pagevec *pvec,
|
||||||
struct address_space *mapping,
|
struct address_space *mapping,
|
||||||
pgoff_t *start, pgoff_t end);
|
pgoff_t *start, pgoff_t end);
|
||||||
|
@ -146,8 +145,5 @@ static inline void folio_batch_release(struct folio_batch *fbatch)
|
||||||
pagevec_release((struct pagevec *)fbatch);
|
pagevec_release((struct pagevec *)fbatch);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
|
void folio_batch_remove_exceptionals(struct folio_batch *fbatch);
|
||||||
{
|
|
||||||
pagevec_remove_exceptionals((struct pagevec *)fbatch);
|
|
||||||
}
|
|
||||||
#endif /* _LINUX_PAGEVEC_H */
|
#endif /* _LINUX_PAGEVEC_H */
|
||||||
|
|
26
mm/swap.c
26
mm/swap.c
|
@ -1077,24 +1077,24 @@ void __pagevec_lru_add(struct pagevec *pvec)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pagevec_remove_exceptionals - pagevec exceptionals pruning
|
* folio_batch_remove_exceptionals() - Prune non-folios from a batch.
|
||||||
* @pvec: The pagevec to prune
|
* @fbatch: The batch to prune
|
||||||
*
|
*
|
||||||
* find_get_entries() fills both pages and XArray value entries (aka
|
* find_get_entries() fills a batch with both folios and shadow/swap/DAX
|
||||||
* exceptional entries) into the pagevec. This function prunes all
|
* entries. This function prunes all the non-folio entries from @fbatch
|
||||||
* exceptionals from @pvec without leaving holes, so that it can be
|
* without leaving holes, so that it can be passed on to folio-only batch
|
||||||
* passed on to page-only pagevec operations.
|
* operations.
|
||||||
*/
|
*/
|
||||||
void pagevec_remove_exceptionals(struct pagevec *pvec)
|
void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
|
||||||
{
|
{
|
||||||
int i, j;
|
unsigned int i, j;
|
||||||
|
|
||||||
for (i = 0, j = 0; i < pagevec_count(pvec); i++) {
|
for (i = 0, j = 0; i < folio_batch_count(fbatch); i++) {
|
||||||
struct page *page = pvec->pages[i];
|
struct folio *folio = fbatch->folios[i];
|
||||||
if (!xa_is_value(page))
|
if (!xa_is_value(folio))
|
||||||
pvec->pages[j++] = page;
|
fbatch->folios[j++] = folio;
|
||||||
}
|
}
|
||||||
pvec->nr = j;
|
fbatch->nr = j;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -57,7 +57,7 @@ static void clear_shadow_entry(struct address_space *mapping, pgoff_t index,
|
||||||
/*
|
/*
|
||||||
* Unconditionally remove exceptional entries. Usually called from truncate
|
* Unconditionally remove exceptional entries. Usually called from truncate
|
||||||
* path. Note that the folio_batch may be altered by this function by removing
|
* path. Note that the folio_batch may be altered by this function by removing
|
||||||
* exceptional entries similar to what pagevec_remove_exceptionals does.
|
* exceptional entries similar to what folio_batch_remove_exceptionals() does.
|
||||||
*/
|
*/
|
||||||
static void truncate_folio_batch_exceptionals(struct address_space *mapping,
|
static void truncate_folio_batch_exceptionals(struct address_space *mapping,
|
||||||
struct folio_batch *fbatch, pgoff_t *indices)
|
struct folio_batch *fbatch, pgoff_t *indices)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue