@@ -1145,7 +1145,7 @@ static inline void folio_put_refs(struct folio *folio, int refs)
__folio_put(folio);
}
-void release_pages(struct page **pages, int nr);
+void release_pages(struct page **pages, unsigned long npages);
/**
* folios_put - Decrement the reference count on an array of folios.
@@ -931,15 +931,15 @@ void lru_cache_disable(void)
* Decrement the reference count on all the pages in @pages. If it
* fell to zero, remove the page from the LRU and free it.
*/
-void release_pages(struct page **pages, int nr)
+void release_pages(struct page **pages, unsigned long npages)
{
- int i;
+ unsigned long i;
LIST_HEAD(pages_to_free);
struct lruvec *lruvec = NULL;
unsigned long flags = 0;
unsigned int lock_batch;
- for (i = 0; i < nr; i++) {
+ for (i = 0; i < npages; i++) {
struct folio *folio = page_folio(pages[i]);
/*
The various callers of release_pages() are passing in either various types (signed or unsigned) and lengths (int or long) of integers, for the second argument (number of pages). To make this conversion accurate and to avoid having to check for overflow (or deal with type conversion warnings), let's just change release_pages() to accept an unsigned long for the number of pages. Also change the name of the argument, from "nr" to "npages", for clarity, as long as that line is being changed anyway. Signed-off-by: John Hubbard <jhubbard@nvidia.com> --- include/linux/mm.h | 2 +- mm/swap.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)