Skip to content

Commit

Permalink
ncpfs: use vma_pages() to replace (vm_end - vm_start) >> PAGE_SHIFT
Browse files Browse the repository at this point in the history
(*->vm_end - *->vm_start) >> PAGE_SHIFT operation is implemented
as a inline funcion vma_pages() in linux/mm.h, so using it.

Signed-off-by: Libin <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
libin2015 authored and torvalds committed Jul 3, 2013
1 parent d6e9321 commit ef9f515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ncpfs/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int ncp_mmap(struct file *file, struct vm_area_struct *vma)
return -EINVAL;
/* we do not support files bigger than 4GB... We eventually
supports just 4GB... */
if (((vma->vm_end - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff
if (vma_pages(vma) + vma->vm_pgoff
> (1U << (32 - PAGE_SHIFT)))
return -EFBIG;

Expand Down

0 comments on commit ef9f515

Please sign in to comment.