Merge branch 'waitid-fix' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[linux-2.6-microblaze.git] / mm / shmem.c
index 9100c49..9418f5a 100644 (file)
@@ -1291,7 +1291,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
                SetPageUptodate(page);
        }
 
-       swap = get_swap_page();
+       swap = get_swap_page(page);
        if (!swap.val)
                goto redirty;
 
@@ -1327,7 +1327,7 @@ static int shmem_writepage(struct page *page, struct writeback_control *wbc)
 
        mutex_unlock(&shmem_swaplist_mutex);
 free_swap:
-       swapcache_free(swap);
+       put_swap_page(page, swap);
 redirty:
        set_page_dirty(page);
        if (wbc->for_reclaim)
@@ -1646,8 +1646,7 @@ repeat:
                        if (fault_type) {
                                *fault_type |= VM_FAULT_MAJOR;
                                count_vm_event(PGMAJFAULT);
-                               mem_cgroup_count_vm_event(charge_mm,
-                                                         PGMAJFAULT);
+                               count_memcg_event_mm(charge_mm, PGMAJFAULT);
                        }
                        /* Here we actually start the io */
                        page = shmem_swapin(swap, gfp, info, index);