summaryrefslogtreecommitdiffstats
path: root/mm/swap_state.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/swap_state.c')
-rw-r--r--mm/swap_state.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/swap_state.c b/mm/swap_state.c
index 8368621a0fc7..8e7ce9a9bc5e 100644
--- a/mm/swap_state.c
+++ b/mm/swap_state.c
@@ -116,7 +116,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp)
116 struct address_space *address_space = swap_address_space(entry); 116 struct address_space *address_space = swap_address_space(entry);
117 pgoff_t idx = swp_offset(entry); 117 pgoff_t idx = swp_offset(entry);
118 XA_STATE_ORDER(xas, &address_space->i_pages, idx, compound_order(page)); 118 XA_STATE_ORDER(xas, &address_space->i_pages, idx, compound_order(page));
119 unsigned long i, nr = 1UL << compound_order(page); 119 unsigned long i, nr = compound_nr(page);
120 120
121 VM_BUG_ON_PAGE(!PageLocked(page), page); 121 VM_BUG_ON_PAGE(!PageLocked(page), page);
122 VM_BUG_ON_PAGE(PageSwapCache(page), page); 122 VM_BUG_ON_PAGE(PageSwapCache(page), page);
@@ -133,7 +133,7 @@ int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp)
133 for (i = 0; i < nr; i++) { 133 for (i = 0; i < nr; i++) {
134 VM_BUG_ON_PAGE(xas.xa_index != idx + i, page); 134 VM_BUG_ON_PAGE(xas.xa_index != idx + i, page);
135 set_page_private(page + i, entry.val + i); 135 set_page_private(page + i, entry.val + i);
136 xas_store(&xas, page + i); 136 xas_store(&xas, page);
137 xas_next(&xas); 137 xas_next(&xas);
138 } 138 }
139 address_space->nrpages += nr; 139 address_space->nrpages += nr;
@@ -168,7 +168,7 @@ void __delete_from_swap_cache(struct page *page, swp_entry_t entry)
168 168
169 for (i = 0; i < nr; i++) { 169 for (i = 0; i < nr; i++) {
170 void *entry = xas_store(&xas, NULL); 170 void *entry = xas_store(&xas, NULL);
171 VM_BUG_ON_PAGE(entry != page + i, entry); 171 VM_BUG_ON_PAGE(entry != page, entry);
172 set_page_private(page + i, 0); 172 set_page_private(page + i, 0);
173 xas_next(&xas); 173 xas_next(&xas);
174 } 174 }