* swapout cursor in a VM_NONLINEAR vma (unless VM_RESERVED * or VM_LOCKED, but VM_LOCKED could be revoked later on). 
* swapout cursor in a VM_NONLINEAR vma. 
asmlinkage long sys_remap_file_pages(unsigned long start, unsigned long size,	unsigned long __prot, unsigned long pgoff, unsigned long flags){	struct mm_struct *mm = current->mm;	struct address_space *mapping;	unsigned long end = start + size;	struct vm_area_struct *vma;	int err = -EINVAL;	int has_write_lock = 0;	if (__prot)		return err;	/*	 * Sanitize the syscall parameters:	 */	start = start & PAGE_MASK;	size = size & PAGE_MASK;	/* Does the address range wrap, or is the span zero-sized? */	if (start + size <= start)		return err;	/* Can we represent this offset inside this architecture's pte's? */#if PTE_FILE_MAX_BITS < BITS_PER_LONG	if (pgoff + (size >> PAGE_SHIFT) >= (1UL << PTE_FILE_MAX_BITS))		return err;#endif	/* We need down_write() to change vma->vm_flags. */	down_read(&mm->mmap_sem); retry:	vma = find_vma(mm, start);	/*	 * Make sure the vma is shared, that it supports prefaulting,	 * and that the remapped range is valid and fully within	 * the single existing vma.  vm_private_data is used as a	 * swapout cursor in a VM_NONLINEAR vma (unless VM_RESERVED	 * or VM_LOCKED, but VM_LOCKED could be revoked later on).	 */	if (vma && (vma->vm_flags & VM_SHARED) &&		(!vma->vm_private_data ||			(vma->vm_flags & (VM_NONLINEAR|VM_RESERVED))) &&		vma->vm_ops && vma->vm_ops->populate &&			end > start && start >= vma->vm_start &&				end <= vma->vm_end) {		/* Must set VM_NONLINEAR before any pages are populated. */		if (pgoff != linear_page_index(vma, start) &&		    !(vma->vm_flags & VM_NONLINEAR)) {			if (!has_write_lock) {				up_read(&mm->mmap_sem);				down_write(&mm->mmap_sem);				has_write_lock = 1;				goto retry;			}			mapping = vma->vm_file->f_mapping;			spin_lock(&mapping->i_mmap_lock);			flush_dcache_mmap_lock(mapping);			vma->vm_flags |= VM_NONLINEAR;			vma_prio_tree_remove(vma, &mapping->i_mmap);			vma_nonlinear_insert(vma, &mapping->i_mmap_nonlinear);			flush_dcache_mmap_unlock(mapping);			spin_unlock(&mapping->i_mmap_lock);		}		err = vma->vm_ops->populate(vma, start, size,					    vma->vm_page_prot,					    pgoff, flags & MAP_NONBLOCK);		/*		 * We can't clear VM_NONLINEAR because we'd have to do		 * it after ->populate completes, and that would prevent		 * downgrading the lock.  (Locks can't be upgraded).		 */	}	if (likely(!has_write_lock))		up_read(&mm->mmap_sem);	else		up_write(&mm->mmap_sem);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/101d2be7646b7dd1c367d50208a59b29fce61398/fremap.c/buggy/mm/fremap.c