]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - mm/shmem.c
mm: fault feedback #2
[mirror_ubuntu-zesty-kernel.git] / mm / shmem.c
index 0a555af8733d42d6325dcd53a36b98b6c29c3777..ad155c7745dc679252957b8df44461ba0f959d2b 100644 (file)
@@ -1103,7 +1103,7 @@ static int shmem_getpage(struct inode *inode, unsigned long idx,
                return -EFBIG;
 
        if (type)
-               *type = VM_FAULT_MINOR;
+               *type = 0;
 
        /*
         * Normally, filepage is NULL on entry, and either found
@@ -1138,9 +1138,9 @@ repeat:
                if (!swappage) {
                        shmem_swp_unmap(entry);
                        /* here we actually do the io */
-                       if (type && *type == VM_FAULT_MINOR) {
+                       if (type && !(*type & VM_FAULT_MAJOR)) {
                                __count_vm_event(PGMAJFAULT);
-                               *type = VM_FAULT_MAJOR;
+                               *type |= VM_FAULT_MAJOR;
                        }
                        spin_unlock(&info->lock);
                        swappage = shmem_swapin(info, swap, idx);
@@ -1323,7 +1323,7 @@ static int shmem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
                return ((error == -ENOMEM) ? VM_FAULT_OOM : VM_FAULT_SIGBUS);
 
        mark_page_accessed(vmf->page);
-       return ret | FAULT_RET_LOCKED;
+       return ret | VM_FAULT_LOCKED;
 }
 
 #ifdef CONFIG_NUMA