]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/rmap.c
mg_disk: Add missing ready status check on mg_write()
[mirror_ubuntu-artful-kernel.git] / mm / rmap.c
index c9ccc1a72dc32652827c0d6d81add911f59abbfb..836c6c63e1f2dbee16a922f7195da2f3ac237d83 100644 (file)
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -703,8 +703,10 @@ void page_add_new_anon_rmap(struct page *page,
  */
 void page_add_file_rmap(struct page *page)
 {
-       if (atomic_inc_and_test(&page->_mapcount))
+       if (atomic_inc_and_test(&page->_mapcount)) {
                __inc_zone_page_state(page, NR_FILE_MAPPED);
+               mem_cgroup_update_mapped_file_stat(page, 1);
+       }
 }
 
 #ifdef CONFIG_DEBUG_VM
@@ -753,6 +755,7 @@ void page_remove_rmap(struct page *page)
                        mem_cgroup_uncharge_page(page);
                __dec_zone_page_state(page,
                        PageAnon(page) ? NR_ANON_PAGES : NR_FILE_MAPPED);
+               mem_cgroup_update_mapped_file_stat(page, -1);
                /*
                 * It would be tidy to reset the PageAnon mapping here,
                 * but that might overwrite a racing page_add_anon_rmap