linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / mm / fremap.c
index 653b56f..08efbb6 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/rmap.h>
 #include <linux/module.h>
 #include <linux/syscalls.h>
+#include <linux/vs_base.h>
 #include <linux/vs_memory.h>
 
 #include <asm/mmu_context.h>
@@ -36,7 +37,6 @@ static int zap_pte(struct mm_struct *mm, struct vm_area_struct *vma,
                                set_page_dirty(page);
                        page_remove_rmap(page);
                        page_cache_release(page);
-                       // dec_mm_counter(mm, file_rss);
                }
        } else {
                if (!pte_file(pte))
@@ -69,17 +69,15 @@ int install_page(struct mm_struct *mm, struct vm_area_struct *vma,
         * caller about it.
         */
        err = -EINVAL;
-       if (vma->vm_file) {
-               inode = vma->vm_file->f_mapping->host;
-               size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
-               if (!page->mapping || page->index >= size)
-                       goto unlock;
-               err = -ENOMEM;
-               if (page_mapcount(page) > INT_MAX/2)
-                       goto unlock;
-               if (!vx_rsspages_avail(mm, 1))
-                       goto unlock;
-       }
+       inode = vma->vm_file->f_mapping->host;
+       size = (i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
+       if (!page->mapping || page->index >= size)
+               goto unlock;
+       err = -ENOMEM;
+       if (page_mapcount(page) > INT_MAX/2)
+               goto unlock;
+       if (!vx_rsspages_avail(mm, 1))
+               goto unlock;
 
        if (pte_none(*pte) || !zap_pte(mm, vma, addr, pte))
                inc_mm_counter(mm, file_rss);