kernels/linux-2.4.0/mm/shmem.c
/*
 * shmem_zero_setup - setup a shared anonymous mapping
 *
 * @vma: the vma to be mmapped is prepared by do_mmap_pgoff
 */
setup a shared anonymous mapping
@vma: the vma to be mmapped is prepared by do_mmap_pgoff
setup a shared anonymous mapping @vma : the vma to be mmapped is prepared by do_mmap_pgoff
int shmem_zero_setup(struct vm_area_struct *vma)
{
	struct file *file;
	loff_t size = vma->vm_end - vma->vm_start;
	file = shmem_file_setup("dev/zero", size);
	if (IS_ERR(file))
		return PTR_ERR(file);
	if (vma->vm_file)
		fput (vma->vm_file);
	vma->vm_file = file;
	vma->vm_ops = &shmem_shared_vm_ops;
	return 0;
}
int shmem_zero_setup ( struct vm_area_struct * vma ) { struct file * file ; loff_t size = vma -> vm_end - vma -> vm_start ; file = shmem_file_setup ( " " , size ) ; if ( IS_ERR ( file ) ) return PTR_ERR ( file ) ; if ( vma -> vm_file ) fput ( vma -> vm_file ) ; vma -> vm_file = file ; vma -> vm_ops = & shmem_shared_vm_ops ; return 0 ; }
shmem_zero_setup - setup a shared anonymous mapping
 @vma: the vma to be mmapped is prepared by do_mmap_pgoff
shmem_zero_setup - setup a shared anonymous mapping @vma : the vma to be mmapped is prepared by do_mmap_pgoff