 bytes = huge_pages_needed(mapping, vma); if (!is_hugepage_mem_enough(bytes)) return -ENOMEM; 
static int hugetlbfs_file_mmap(struct file *file, struct vm_area_struct *vma){	struct inode *inode = file->f_dentry->d_inode;	loff_t len, vma_len;	int ret;	if ((vma->vm_flags & (VM_MAYSHARE | VM_WRITE)) == VM_WRITE)		return -EINVAL;	if (vma->vm_pgoff & (HPAGE_SIZE / PAGE_SIZE - 1))		return -EINVAL;	if (vma->vm_start & ~HPAGE_MASK)		return -EINVAL;	if (vma->vm_end & ~HPAGE_MASK)		return -EINVAL;	if (vma->vm_end - vma->vm_start < HPAGE_SIZE)		return -EINVAL;	vma_len = (loff_t)(vma->vm_end - vma->vm_start);	down(&inode->i_sem);	file_accessed(file);	vma->vm_flags |= VM_HUGETLB | VM_RESERVED;	vma->vm_ops = &hugetlb_vm_ops;	ret = -ENOMEM;	len = vma_len + ((loff_t)vma->vm_pgoff << PAGE_SHIFT);	if (!(vma->vm_flags & VM_WRITE) && len > inode->i_size)		goto out;	ret = 0;	hugetlb_prefault_arch_hook(vma->vm_mm);	if (inode->i_size < len)		inode->i_size = len;out:	up(&inode->i_sem);	return ret;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2e9b367c2273ed21c9852a04d90944d472c4f3e6/inode.c/clean/fs/hugetlbfs/inode.c