]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/nommu.c
mm, oom: rework oom detection
[mirror_ubuntu-artful-kernel.git] / mm / nommu.c
index 92be862c859bdce2b149e86760522ccb6d230524..29179f7059b5c88d48064755ff3ec98e0e649959 100644 (file)
@@ -671,7 +671,7 @@ static void __put_nommu_region(struct vm_region *region)
                up_write(&nommu_region_sem);
 
                if (region->vm_file)
-                       fput(region->vm_file);
+                       vmr_fput(region);
 
                /* IO memory and memory shared directly out of the pagecache
                 * from ramfs/tmpfs mustn't be released here */
@@ -829,7 +829,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
        if (vma->vm_ops && vma->vm_ops->close)
                vma->vm_ops->close(vma);
        if (vma->vm_file)
-               fput(vma->vm_file);
+               vma_fput(vma);
        put_nommu_region(vma->vm_region);
        kmem_cache_free(vm_area_cachep, vma);
 }
@@ -1355,7 +1355,7 @@ unsigned long do_mmap(struct file *file,
                                        goto error_just_free;
                                }
                        }
-                       fput(region->vm_file);
+                       vmr_fput(region);
                        kmem_cache_free(vm_region_jar, region);
                        region = pregion;
                        result = start;
@@ -1430,10 +1430,10 @@ error_just_free:
        up_write(&nommu_region_sem);
 error:
        if (region->vm_file)
-               fput(region->vm_file);
+               vmr_fput(region);
        kmem_cache_free(vm_region_jar, region);
        if (vma->vm_file)
-               fput(vma->vm_file);
+               vma_fput(vma);
        kmem_cache_free(vm_area_cachep, vma);
        return ret;