map = ZERO_PAGE(start); 
page = ZERO_PAGE(start); 
int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,		unsigned long start, int len, int write, int force,		struct page **pages, struct vm_area_struct **vmas){	int i;	unsigned int flags;	/* 	 * Require read or write permissions.	 * If 'force' is set, we only require the "MAY" flags.	 */	flags = write ? (VM_WRITE | VM_MAYWRITE) : (VM_READ | VM_MAYREAD);	flags &= force ? (VM_MAYREAD | VM_MAYWRITE) : (VM_READ | VM_WRITE);	i = 0;	do {		struct vm_area_struct *	vma;		vma = find_extend_vma(mm, start);		if (!vma && in_gate_area(tsk, start)) {			unsigned long pg = start & PAGE_MASK;			struct vm_area_struct *gate_vma = get_gate_vma(tsk);			pgd_t *pgd;			pud_t *pud;			pmd_t *pmd;			pte_t *pte;			if (write) /* user gate pages are read-only */				return i ? : -EFAULT;			if (pg > TASK_SIZE)				pgd = pgd_offset_k(pg);			else				pgd = pgd_offset_gate(mm, pg);			BUG_ON(pgd_none(*pgd));			pud = pud_offset(pgd, pg);			BUG_ON(pud_none(*pud));			pmd = pmd_offset(pud, pg);			BUG_ON(pmd_none(*pmd));			pte = pte_offset_map(pmd, pg);			BUG_ON(pte_none(*pte));			if (pages) {				pages[i] = pte_page(*pte);				get_page(pages[i]);			}			pte_unmap(pte);			if (vmas)				vmas[i] = gate_vma;			i++;			start += PAGE_SIZE;			len--;			continue;		}		if (!vma || (vma->vm_flags & VM_IO)				|| !(flags & vma->vm_flags))			return i ? : -EFAULT;		if (is_vm_hugetlb_page(vma)) {			i = follow_hugetlb_page(mm, vma, pages, vmas,						&start, &len, i);			continue;		}		spin_lock(&mm->page_table_lock);		do {			struct page *map;			int lookup_write = write;			cond_resched_lock(&mm->page_table_lock);			while (!(map = follow_page(mm, start, lookup_write))) {				/*				 * Shortcut for anonymous pages. We don't want				 * to force the creation of pages tables for				 * insanly big anonymously mapped areas that				 * nobody touched so far. This is important				 * for doing a core dump for these mappings.				 */				if (!lookup_write &&				    untouched_anonymous_page(mm,vma,start)) {					map = ZERO_PAGE(start);					break;				}				spin_unlock(&mm->page_table_lock);				switch (handle_mm_fault(mm,vma,start,write)) {				case VM_FAULT_MINOR:					tsk->min_flt++;					break;				case VM_FAULT_MAJOR:					tsk->maj_flt++;					break;				case VM_FAULT_SIGBUS:					return i ? i : -EFAULT;				case VM_FAULT_OOM:					return i ? i : -ENOMEM;				default:					BUG();				}				/*				 * Now that we have performed a write fault				 * and surely no longer have a shared page we				 * shouldn't write, we shouldn't ignore an				 * unwritable page in the page table if				 * we are forcing write access.				 */				lookup_write = write && !force;				spin_lock(&mm->page_table_lock);			}			if (pages) {				pages[i] = get_page_map(map);				if (!pages[i]) {					spin_unlock(&mm->page_table_lock);					while (i--)						page_cache_release(pages[i]);					i = -EFAULT;					goto out;				}				flush_dcache_page(pages[i]);				if (!PageReserved(pages[i]))					page_cache_get(pages[i]);			}			if (vmas)				vmas[i] = vma;			i++;			start += PAGE_SIZE;			len--;		} while(len && start < vma->vm_end);		spin_unlock(&mm->page_table_lock);	} while(len);out:	return i;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/08ef472937e918875a82fd350d3de138aac50414/memory.c/buggy/mm/memory.c