Skip to content

Commit a656a20

Browse files
Matthew Wilcox (Oracle)torvalds
authored andcommitted
mm: remove pagevec_lookup_entries
pagevec_lookup_entries() is now just a wrapper around find_get_entries() so remove it and convert all its callers. Link: https://lkml.kernel.org/r/20201112212641.27837-15-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: William Kucharski <william.kucharski@oracle.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Cc: Dave Chinner <dchinner@redhat.com> Cc: Hugh Dickins <hughd@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Cc: Yang Shi <yang.shi@linux.alibaba.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent cf2039a commit a656a20

File tree

3 files changed

+4
-39
lines changed

3 files changed

+4
-39
lines changed

include/linux/pagevec.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ struct pagevec {
2525

2626
void __pagevec_release(struct pagevec *pvec);
2727
void __pagevec_lru_add(struct pagevec *pvec);
28-
unsigned pagevec_lookup_entries(struct pagevec *pvec,
29-
struct address_space *mapping, pgoff_t start, pgoff_t end,
30-
pgoff_t *indices);
3128
void pagevec_remove_exceptionals(struct pagevec *pvec);
3229
unsigned pagevec_lookup_range(struct pagevec *pvec,
3330
struct address_space *mapping,

mm/swap.c

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,44 +1017,12 @@ void __pagevec_lru_add(struct pagevec *pvec)
10171017
pagevec_reinit(pvec);
10181018
}
10191019

1020-
/**
1021-
* pagevec_lookup_entries - gang pagecache lookup
1022-
* @pvec: Where the resulting entries are placed
1023-
* @mapping: The address_space to search
1024-
* @start: The starting entry index
1025-
* @end: The highest index to return (inclusive).
1026-
* @nr_entries: The maximum number of pages
1027-
* @indices: The cache indices corresponding to the entries in @pvec
1028-
*
1029-
* pagevec_lookup_entries() will search for and return a group of up
1030-
* to @nr_pages pages and shadow entries in the mapping. All
1031-
* entries are placed in @pvec. pagevec_lookup_entries() takes a
1032-
* reference against actual pages in @pvec.
1033-
*
1034-
* The search returns a group of mapping-contiguous entries with
1035-
* ascending indexes. There may be holes in the indices due to
1036-
* not-present entries.
1037-
*
1038-
* Only one subpage of a Transparent Huge Page is returned in one call:
1039-
* allowing truncate_inode_pages_range() to evict the whole THP without
1040-
* cycling through a pagevec of extra references.
1041-
*
1042-
* pagevec_lookup_entries() returns the number of entries which were
1043-
* found.
1044-
*/
1045-
unsigned pagevec_lookup_entries(struct pagevec *pvec,
1046-
struct address_space *mapping, pgoff_t start, pgoff_t end,
1047-
pgoff_t *indices)
1048-
{
1049-
return find_get_entries(mapping, start, end, pvec, indices);
1050-
}
1051-
10521020
/**
10531021
* pagevec_remove_exceptionals - pagevec exceptionals pruning
10541022
* @pvec: The pagevec to prune
10551023
*
1056-
* pagevec_lookup_entries() fills both pages and exceptional radix
1057-
* tree entries into the pagevec. This function prunes all
1024+
* find_get_entries() fills both pages and XArray value entries (aka
1025+
* exceptional entries) into the pagevec. This function prunes all
10581026
* exceptionals from @pvec without leaving holes, so that it can be
10591027
* passed on to page-only pagevec operations.
10601028
*/

mm/truncate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ void truncate_inode_pages_range(struct address_space *mapping,
376376
index = start;
377377
for ( ; ; ) {
378378
cond_resched();
379-
if (!pagevec_lookup_entries(&pvec, mapping, index, end - 1,
379+
if (!find_get_entries(mapping, index, end - 1, &pvec,
380380
indices)) {
381381
/* If all gone from start onwards, we're done */
382382
if (index == start)
@@ -638,7 +638,7 @@ int invalidate_inode_pages2_range(struct address_space *mapping,
638638

639639
pagevec_init(&pvec);
640640
index = start;
641-
while (pagevec_lookup_entries(&pvec, mapping, index, end, indices)) {
641+
while (find_get_entries(mapping, index, end, &pvec, indices)) {
642642
for (i = 0; i < pagevec_count(&pvec); i++) {
643643
struct page *page = pvec.pages[i];
644644

0 commit comments

Comments
 (0)