Convert __free_zspage() to use zsdesc. Signed-off-by: Hyeonggon Yoo <42.hyeyoo@xxxxxxxxx> --- mm/zsmalloc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index ced7f144b884..7ec616ec5cf5 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1148,7 +1148,7 @@ static inline void free_handles(struct zs_pool *pool, struct size_class *class, static void __free_zspage(struct zs_pool *pool, struct size_class *class, struct zspage *zspage) { - struct page *page, *next; + struct zsdesc *zsdesc, *next; enum fullness_group fg; unsigned int class_idx; @@ -1162,16 +1162,16 @@ static void __free_zspage(struct zs_pool *pool, struct size_class *class, /* Free all deferred handles from zs_free */ free_handles(pool, class, zspage); - next = page = get_first_page(zspage); + next = zsdesc = get_first_zsdesc(zspage); do { - VM_BUG_ON_PAGE(!PageLocked(page), page); - next = get_next_page(page); - reset_zsdesc(page_zsdesc(page)); - unlock_page(page); - dec_zone_page_state(page, NR_ZSPAGES); - put_page(page); - page = next; - } while (page != NULL); + VM_BUG_ON_PAGE(!zsdesc_is_locked(zsdesc), zsdesc_page(zsdesc)); + next = get_next_zsdesc(zsdesc); + reset_zsdesc(zsdesc); + unlock_zsdesc(zsdesc); + zsdesc_dec_zone_page_state(zsdesc); + zsdesc_put(zsdesc); + zsdesc = next; + } while (zsdesc != NULL); cache_free_zspage(pool, zspage); -- 2.25.1