Skip to content

Commit 1613fac

Browse files
author
Matthew Wilcox (Oracle)
committed
mm: Remove pagevec_remove_exceptionals()
All of its callers now call folio_batch_remove_exceptionals(). Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: William Kucharski <[email protected]>
1 parent 51dcbda commit 1613fac

File tree

3 files changed

+15
-19
lines changed

3 files changed

+15
-19
lines changed

include/linux/pagevec.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ struct pagevec {
2727

2828
void __pagevec_release(struct pagevec *pvec);
2929
void __pagevec_lru_add(struct pagevec *pvec);
30-
void pagevec_remove_exceptionals(struct pagevec *pvec);
3130
unsigned pagevec_lookup_range(struct pagevec *pvec,
3231
struct address_space *mapping,
3332
pgoff_t *start, pgoff_t end);
@@ -146,8 +145,5 @@ static inline void folio_batch_release(struct folio_batch *fbatch)
146145
pagevec_release((struct pagevec *)fbatch);
147146
}
148147

149-
static inline void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
150-
{
151-
pagevec_remove_exceptionals((struct pagevec *)fbatch);
152-
}
148+
void folio_batch_remove_exceptionals(struct folio_batch *fbatch);
153149
#endif /* _LINUX_PAGEVEC_H */

mm/swap.c

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,24 +1077,24 @@ void __pagevec_lru_add(struct pagevec *pvec)
10771077
}
10781078

10791079
/**
1080-
* pagevec_remove_exceptionals - pagevec exceptionals pruning
1081-
* @pvec: The pagevec to prune
1080+
* folio_batch_remove_exceptionals() - Prune non-folios from a batch.
1081+
* @fbatch: The batch to prune
10821082
*
1083-
* find_get_entries() fills both pages and XArray value entries (aka
1084-
* exceptional entries) into the pagevec. This function prunes all
1085-
* exceptionals from @pvec without leaving holes, so that it can be
1086-
* passed on to page-only pagevec operations.
1083+
* find_get_entries() fills a batch with both folios and shadow/swap/DAX
1084+
* entries. This function prunes all the non-folio entries from @fbatch
1085+
* without leaving holes, so that it can be passed on to folio-only batch
1086+
* operations.
10871087
*/
1088-
void pagevec_remove_exceptionals(struct pagevec *pvec)
1088+
void folio_batch_remove_exceptionals(struct folio_batch *fbatch)
10891089
{
1090-
int i, j;
1090+
unsigned int i, j;
10911091

1092-
for (i = 0, j = 0; i < pagevec_count(pvec); i++) {
1093-
struct page *page = pvec->pages[i];
1094-
if (!xa_is_value(page))
1095-
pvec->pages[j++] = page;
1092+
for (i = 0, j = 0; i < folio_batch_count(fbatch); i++) {
1093+
struct folio *folio = fbatch->folios[i];
1094+
if (!xa_is_value(folio))
1095+
fbatch->folios[j++] = folio;
10961096
}
1097-
pvec->nr = j;
1097+
fbatch->nr = j;
10981098
}
10991099

11001100
/**

mm/truncate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static void clear_shadow_entry(struct address_space *mapping, pgoff_t index,
5757
/*
5858
* Unconditionally remove exceptional entries. Usually called from truncate
5959
* path. Note that the folio_batch may be altered by this function by removing
60-
* exceptional entries similar to what pagevec_remove_exceptionals does.
60+
* exceptional entries similar to what folio_batch_remove_exceptionals() does.
6161
*/
6262
static void truncate_folio_batch_exceptionals(struct address_space *mapping,
6363
struct folio_batch *fbatch, pgoff_t *indices)

0 commit comments

Comments
 (0)