These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / mm / madvise.c
index d551475..c889fcb 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/fs.h>
 #include <linux/file.h>
 #include <linux/blkdev.h>
+#include <linux/backing-dev.h>
 #include <linux/swap.h>
 #include <linux/swapops.h>
 
@@ -102,7 +103,8 @@ static long madvise_behavior(struct vm_area_struct *vma,
 
        pgoff = vma->vm_pgoff + ((start - vma->vm_start) >> PAGE_SHIFT);
        *prev = vma_merge(mm, *prev, start, end, new_flags, vma->anon_vma,
-                               vma->vm_file, pgoff, vma_policy(vma));
+                         vma->vm_file, pgoff, vma_policy(vma),
+                         vma->vm_userfaultfd_ctx);
        if (*prev) {
                vma = *prev;
                goto success;
@@ -299,7 +301,7 @@ static long madvise_remove(struct vm_area_struct *vma,
 
        *prev = NULL;   /* tell sys_madvise we drop mmap_sem */
 
-       if (vma->vm_flags & (VM_LOCKED | VM_HUGETLB))
+       if (vma->vm_flags & VM_LOCKED)
                return -EINVAL;
 
        f = vma->vm_file;
@@ -384,7 +386,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev,
        }
 }
 
-static int
+static bool
 madvise_behavior_valid(int behavior)
 {
        switch (behavior) {
@@ -406,10 +408,10 @@ madvise_behavior_valid(int behavior)
 #endif
        case MADV_DONTDUMP:
        case MADV_DODUMP:
-               return 1;
+               return true;
 
        default:
-               return 0;
+               return false;
        }
 }