summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2022-09-02 21:46:09 +0200
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 23:02:46 +0200
commit4081f7446d95a9d3ced12dc04ff02c187a761e90 (patch)
treed111975fe5323a36a9ac37434d4dded1b88e7666 /mm
parentmm/swap: convert add_to_swap_cache() to take a folio (diff)
downloadlinux-4081f7446d95a9d3ced12dc04ff02c187a761e90.tar.xz
linux-4081f7446d95a9d3ced12dc04ff02c187a761e90.zip
mm/swap: convert put_swap_page() to put_swap_folio()
With all callers now using a folio, we can convert this function. Link: https://lkml.kernel.org/r/20220902194653.1739778-14-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/shmem.c2
-rw-r--r--mm/swap_slots.c2
-rw-r--r--mm/swap_state.c6
-rw-r--r--mm/swapfile.c4
-rw-r--r--mm/vmscan.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index ced76c229b96..56cabf9bb947 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1424,7 +1424,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
}
mutex_unlock(&shmem_swaplist_mutex);
- put_swap_page(&folio->page, swap);
+ put_swap_folio(folio, swap);
redirty:
folio_mark_dirty(folio);
if (wbc->for_reclaim)
diff --git a/mm/swap_slots.c b/mm/swap_slots.c
index 10b94d64cc25..0bec1f705f8e 100644
--- a/mm/swap_slots.c
+++ b/mm/swap_slots.c
@@ -343,7 +343,7 @@ repeat:
get_swap_pages(1, &entry, 1);
out:
if (mem_cgroup_try_charge_swap(folio, entry)) {
- put_swap_page(&folio->page, entry);
+ put_swap_folio(folio, entry);
entry.val = 0;
}
return entry;
diff --git a/mm/swap_state.c b/mm/swap_state.c
index ecf1accc2fb1..ea354efd3735 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -218,7 +218,7 @@ bool add_to_swap(struct folio *folio)
return true;
fail:
- put_swap_page(&folio->page, entry);
+ put_swap_folio(folio, entry);
return false;
}
@@ -237,7 +237,7 @@ void delete_from_swap_cache(struct folio *folio)
__delete_from_swap_cache(folio, entry, NULL);
xa_unlock_irq(&address_space->i_pages);
- put_swap_page(&folio->page, entry);
+ put_swap_folio(folio, entry);
folio_ref_sub(folio, folio_nr_pages(folio));
}
@@ -498,7 +498,7 @@ struct page *__read_swap_cache_async(swp_entry_t entry, gfp_t gfp_mask,
return &folio->page;
fail_unlock:
- put_swap_page(&folio->page, entry);
+ put_swap_folio(folio, entry);
folio_unlock(folio);
folio_put(folio);
return NULL;
diff --git a/mm/swapfile.c b/mm/swapfile.c
index f2a446799a39..aafe739dc2a6 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -1332,7 +1332,7 @@ void swap_free(swp_entry_t entry)
/*
* Called after dropping swapcache to decrease refcnt to swap entries.
*/
-void put_swap_page(struct page *page, swp_entry_t entry)
+void put_swap_folio(struct folio *folio, swp_entry_t entry)
{
unsigned long offset = swp_offset(entry);
unsigned long idx = offset / SWAPFILE_CLUSTER;
@@ -1341,7 +1341,7 @@ void put_swap_page(struct page *page, swp_entry_t entry)
unsigned char *map;
unsigned int i, free_entries = 0;
unsigned char val;
- int size = swap_entry_size(thp_nr_pages(page));
+ int size = swap_entry_size(folio_nr_pages(folio));
si = _swap_info_get(entry);
if (!si)
diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9268e64590e4..1707e3bfcfe4 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -1352,7 +1352,7 @@ static int __remove_mapping(struct address_space *mapping, struct folio *folio,
mem_cgroup_swapout(folio, swap);
__delete_from_swap_cache(folio, swap, shadow);
xa_unlock_irq(&mapping->i_pages);
- put_swap_page(&folio->page, swap);
+ put_swap_folio(folio, swap);
} else {
void (*free_folio)(struct folio *);