aboutsummaryrefslogtreecommitdiffstats
path: root/mm/mmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/mmap.c')
-rw-r--r--mm/mmap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/mmap.c b/mm/mmap.c
index c739d6db7193..79bcc9f92e48 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -1490,13 +1490,14 @@ SYSCALL_DEFINE1(old_mmap, struct mmap_arg_struct __user *, arg)
1490int vma_wants_writenotify(struct vm_area_struct *vma) 1490int vma_wants_writenotify(struct vm_area_struct *vma)
1491{ 1491{
1492 vm_flags_t vm_flags = vma->vm_flags; 1492 vm_flags_t vm_flags = vma->vm_flags;
1493 const struct vm_operations_struct *vm_ops = vma->vm_ops;
1493 1494
1494 /* If it was private or non-writable, the write bit is already clear */ 1495 /* If it was private or non-writable, the write bit is already clear */
1495 if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED))) 1496 if ((vm_flags & (VM_WRITE|VM_SHARED)) != ((VM_WRITE|VM_SHARED)))
1496 return 0; 1497 return 0;
1497 1498
1498 /* The backer wishes to know when pages are first written to? */ 1499 /* The backer wishes to know when pages are first written to? */
1499 if (vma->vm_ops && vma->vm_ops->page_mkwrite) 1500 if (vm_ops && (vm_ops->page_mkwrite || vm_ops->pfn_mkwrite))
1500 return 1; 1501 return 1;
1501 1502
1502 /* The open routine did something to the protections that pgprot_modify 1503 /* The open routine did something to the protections that pgprot_modify