]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - mm/shmem.c
mm, memory_hotplug: fix MMOP_ONLINE_KEEP behavior
[mirror_ubuntu-artful-kernel.git] / mm / shmem.c
index e67d6ba4e98e73210c8046e82612180fca220e89..a06f23731d3f96db3a2b134d0d62b3c78dcef00c 100644 (file)
@@ -75,6 +75,7 @@ static struct vfsmount *shm_mnt;
 #include <uapi/linux/memfd.h>
 #include <linux/userfaultfd_k.h>
 #include <linux/rmap.h>
+#include <linux/uuid.h>
 
 #include <linux/uaccess.h>
 #include <asm/pgtable.h>
@@ -1290,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;
 
@@ -1326,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)
@@ -1902,10 +1903,10 @@ unlock:
  * entry unconditionally - even if something else had already woken the
  * target.
  */
-static int synchronous_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key)
+static int synchronous_wake_function(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
 {
        int ret = default_wake_function(wait, mode, sync, key);
-       list_del_init(&wait->task_list);
+       list_del_init(&wait->entry);
        return ret;
 }
 
@@ -2840,7 +2841,7 @@ static long shmem_fallocate(struct file *file, int mode, loff_t offset,
                spin_lock(&inode->i_lock);
                inode->i_private = NULL;
                wake_up_all(&shmem_falloc_waitq);
-               WARN_ON_ONCE(!list_empty(&shmem_falloc_waitq.task_list));
+               WARN_ON_ONCE(!list_empty(&shmem_falloc_waitq.head));
                spin_unlock(&inode->i_lock);
                error = 0;
                goto out;
@@ -3761,6 +3762,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent)
 #ifdef CONFIG_TMPFS_POSIX_ACL
        sb->s_flags |= MS_POSIXACL;
 #endif
+       uuid_gen(&sb->s_uuid);
 
        inode = shmem_get_inode(sb, NULL, S_IFDIR | sbinfo->mode, 0, VM_NORESERVE);
        if (!inode)