Lines Matching refs:new_zhdr

601 	struct z3fold_header *new_zhdr = NULL;  in compact_single_buddy()  local
633 new_zhdr = __z3fold_alloc(pool, sz, false); in compact_single_buddy()
634 if (!new_zhdr) in compact_single_buddy()
637 if (WARN_ON(new_zhdr == zhdr)) in compact_single_buddy()
640 new_bud = get_free_buddy(new_zhdr, chunks); in compact_single_buddy()
641 q = new_zhdr; in compact_single_buddy()
644 new_zhdr->first_chunks = chunks; in compact_single_buddy()
648 new_zhdr->middle_chunks = chunks; in compact_single_buddy()
649 new_zhdr->start_middle = in compact_single_buddy()
650 new_zhdr->first_chunks + ZHDR_CHUNKS; in compact_single_buddy()
651 q += new_zhdr->start_middle << CHUNK_SHIFT; in compact_single_buddy()
654 new_zhdr->last_chunks = chunks; in compact_single_buddy()
655 q += PAGE_SIZE - (new_zhdr->last_chunks << CHUNK_SHIFT); in compact_single_buddy()
660 new_zhdr->foreign_handles++; in compact_single_buddy()
663 *(unsigned long *)old_handle = (unsigned long)new_zhdr + in compact_single_buddy()
664 __idx(new_zhdr, new_bud); in compact_single_buddy()
667 (new_zhdr->last_chunks << BUDDY_SHIFT); in compact_single_buddy()
669 add_to_unbuddied(pool, new_zhdr); in compact_single_buddy()
670 z3fold_page_unlock(new_zhdr); in compact_single_buddy()
675 return new_zhdr; in compact_single_buddy()
678 if (new_zhdr && !put_z3fold_locked(new_zhdr)) { in compact_single_buddy()
679 add_to_unbuddied(pool, new_zhdr); in compact_single_buddy()
680 z3fold_page_unlock(new_zhdr); in compact_single_buddy()
1289 struct z3fold_header *zhdr, *new_zhdr; in z3fold_page_migrate() local
1310 new_zhdr = page_address(newpage); in z3fold_page_migrate()
1311 memcpy(new_zhdr, zhdr, PAGE_SIZE); in z3fold_page_migrate()
1315 spin_lock_init(&new_zhdr->page_lock); in z3fold_page_migrate()
1316 INIT_WORK(&new_zhdr->work, compact_page_work); in z3fold_page_migrate()
1321 INIT_LIST_HEAD(&new_zhdr->buddy); in z3fold_page_migrate()
1325 z3fold_page_lock(new_zhdr); in z3fold_page_migrate()
1326 if (new_zhdr->first_chunks) in z3fold_page_migrate()
1327 encode_handle(new_zhdr, FIRST); in z3fold_page_migrate()
1328 if (new_zhdr->last_chunks) in z3fold_page_migrate()
1329 encode_handle(new_zhdr, LAST); in z3fold_page_migrate()
1330 if (new_zhdr->middle_chunks) in z3fold_page_migrate()
1331 encode_handle(new_zhdr, MIDDLE); in z3fold_page_migrate()
1333 new_zhdr->cpu = smp_processor_id(); in z3fold_page_migrate()
1335 z3fold_page_unlock(new_zhdr); in z3fold_page_migrate()
1337 queue_work_on(new_zhdr->cpu, pool->compact_wq, &new_zhdr->work); in z3fold_page_migrate()