]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/xfs/xfs_aops.c
Merge branch 'akpm-current/current'
[karo-tx-linux.git] / fs / xfs / xfs_aops.c
index 14ac9822b3036284692228ad57f1956029bc958b..8c1853dfe63b29541da079356e217d7d0563ab0a 100644 (file)
@@ -1883,7 +1883,6 @@ xfs_vm_set_page_dirty(
        loff_t                  end_offset;
        loff_t                  offset;
        int                     newly_dirty;
-       struct mem_cgroup       *memcg;
 
        if (unlikely(!mapping))
                return !TestSetPageDirty(page);
@@ -1904,10 +1903,10 @@ xfs_vm_set_page_dirty(
                } while (bh != head);
        }
        /*
-        * Use mem_group_begin_page_stat() to keep PageDirty synchronized with
-        * per-memcg dirty page counters.
+        * Lock out page->mem_cgroup migration to keep PageDirty
+        * synchronized with per-memcg dirty page counters.
         */
-       memcg = mem_cgroup_begin_page_stat(page);
+       lock_page_memcg(page);
        newly_dirty = !TestSetPageDirty(page);
        spin_unlock(&mapping->private_lock);
 
@@ -1918,13 +1917,13 @@ xfs_vm_set_page_dirty(
                spin_lock_irqsave(&mapping->tree_lock, flags);
                if (page->mapping) {    /* Race with truncate? */
                        WARN_ON_ONCE(!PageUptodate(page));
-                       account_page_dirtied(page, mapping, memcg);
+                       account_page_dirtied(page, mapping);
                        radix_tree_tag_set(&mapping->page_tree,
                                        page_index(page), PAGECACHE_TAG_DIRTY);
                }
                spin_unlock_irqrestore(&mapping->tree_lock, flags);
        }
-       mem_cgroup_end_page_stat(memcg);
+       unlock_page_memcg(page);
        if (newly_dirty)
                __mark_inode_dirty(mapping->host, I_DIRTY_PAGES);
        return newly_dirty;