summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mm/zsmalloc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 0b4790e81193..49143de9934c 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1741,10 +1741,11 @@ static void zs_object_copy(struct size_class *class, unsigned long dst,
* return handle.
*/
static unsigned long find_alloced_obj(struct size_class *class,
- struct page *page, int index)
+ struct page *page, int *obj_idx)
{
unsigned long head;
int offset = 0;
+ int index = *obj_idx;
unsigned long handle = 0;
void *addr = kmap_atomic(page);
@@ -1765,6 +1766,9 @@ static unsigned long find_alloced_obj(struct size_class *class,
}
kunmap_atomic(addr);
+
+ *obj_idx = index;
+
return handle;
}
@@ -1790,7 +1794,7 @@ static int migrate_zspage(struct zs_pool *pool, struct size_class *class,
int ret = 0;
while (1) {
- handle = find_alloced_obj(class, s_page, obj_idx);
+ handle = find_alloced_obj(class, s_page, &obj_idx);
if (!handle) {
s_page = get_next_page(s_page);
if (!s_page)