• B
    nommu: add page alignment to mmap · f67d9b15
    Bob Liu 提交于
    Currently on nommu arch mmap(),mremap() and munmap() doesn't do
    page_align() which isn't consist with mmu arch and cause some issues.
    
    First, some drivers' mmap() function depends on vma->vm_end - vma->start
    is page aligned which is true on mmu arch but not on nommu.  eg: uvc
    camera driver.
    
    Second munmap() may return -EINVAL[split file] error in cases when end is
    not page aligned(passed into from userspace) but vma->vm_end is aligned
    dure to split or driver's mmap() ops.
    
    Add page alignment to fix those issues.
    
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: NBob Liu <lliubbo@gmail.com>
    Cc: David Howells <dhowells@redhat.com>
    Cc: Paul Mundt <lethal@linux-sh.org>
    Cc: Greg Ungerer <gerg@snapgear.com>
    Cc: Geert Uytterhoeven <geert@linux-m68k.org>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    f67d9b15
nommu.c 50.7 KB