NFSv4: Rename the state reclaimer thread
[safe/jmp/linux-2.6] / mm / rmap.c
index 7e90beb..1099394 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
 
 #include "internal.h"
 
-struct kmem_cache *anon_vma_cachep;
+static struct kmem_cache *anon_vma_cachep;
+
+static inline struct anon_vma *anon_vma_alloc(void)
+{
+       return kmem_cache_alloc(anon_vma_cachep, GFP_KERNEL);
+}
+
+static inline void anon_vma_free(struct anon_vma *anon_vma)
+{
+       kmem_cache_free(anon_vma_cachep, anon_vma);
+}
 
 /**
  * anon_vma_prepare - attach an anon_vma to a memory region
@@ -727,8 +737,8 @@ void page_remove_rmap(struct page *page, struct vm_area_struct *vma)
                        page_clear_dirty(page);
                        set_page_dirty(page);
                }
-
-               mem_cgroup_uncharge_page(page);
+               if (PageAnon(page))
+                       mem_cgroup_uncharge_page(page);
                __dec_zone_page_state(page,
                        PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED);
                /*