/* ZERO_PAGE can be dependant on virtual addr */ if (pfn_valid(pte_pfn(pte)) && pte_page(pte) == ZERO_PAGE(old_addr)) pte = pte_wrprotect(mk_pte(ZERO_PAGE(new_addr), new_vma->vm_page_prot)); 
move_one_page(struct vm_area_struct *vma, unsigned long old_addr,		struct vm_area_struct *new_vma, unsigned long new_addr){	struct address_space *mapping = NULL;	struct mm_struct *mm = vma->vm_mm;	int error = 0;	pte_t *src, *dst;	if (vma->vm_file) {		/*		 * Subtle point from Rajesh Venkatasubramanian: before		 * moving file-based ptes, we must lock vmtruncate out,		 * since it might clean the dst vma before the src vma,		 * and we propagate stale pages into the dst afterward.		 */		mapping = vma->vm_file->f_mapping;		spin_lock(&mapping->i_mmap_lock);		if (new_vma->vm_truncate_count &&		    new_vma->vm_truncate_count != vma->vm_truncate_count)			new_vma->vm_truncate_count = 0;	}	spin_lock(&mm->page_table_lock);	src = get_one_pte_map_nested(mm, old_addr);	if (src) {		/*		 * Look to see whether alloc_one_pte_map needs to perform a		 * memory allocation.  If it does then we need to drop the		 * atomic kmap		 */		dst = get_one_pte_map(mm, new_addr);		if (unlikely(!dst)) {			pte_unmap_nested(src);			if (mapping)				spin_unlock(&mapping->i_mmap_lock);			dst = alloc_one_pte_map(mm, new_addr);			if (mapping && !spin_trylock(&mapping->i_mmap_lock)) {				spin_unlock(&mm->page_table_lock);				spin_lock(&mapping->i_mmap_lock);				spin_lock(&mm->page_table_lock);			}			src = get_one_pte_map_nested(mm, old_addr);		}		/*		 * Since alloc_one_pte_map can drop and re-acquire		 * page_table_lock, we should re-check the src entry...		 */		if (src) {			if (dst) {				pte_t pte;				pte = ptep_clear_flush(vma, old_addr, src);				set_pte_at(mm, new_addr, dst, pte);			} else				error = -ENOMEM;			pte_unmap_nested(src);		}		if (dst)			pte_unmap(dst);	}	spin_unlock(&mm->page_table_lock);	if (mapping)		spin_unlock(&mapping->i_mmap_lock);	return error;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/9a61c349b28ec5aef7e929236571fd770fdef0bb/mremap.c/buggy/mm/mremap.c