mm/memory_hotplug: update comment regarding zone shuffling
[linux-2.6-microblaze.git] / mm / swapfile.c
index ced4635..c4a6136 100644 (file)
@@ -1184,7 +1184,6 @@ static struct swap_info_struct *_swap_info_get(swp_entry_t entry)
 
 bad_free:
        pr_err("swap_info_get: %s%08lx\n", Unused_offset, entry.val);
-       goto out;
 out:
        return NULL;
 }
@@ -1929,11 +1928,6 @@ static int unuse_pte(struct vm_area_struct *vma, pmd_t *pmd,
                lru_cache_add_inactive_or_unevictable(page, vma);
        }
        swap_free(entry);
-       /*
-        * Move the page to the active list so it is not
-        * immediately swapped out again after swapon.
-        */
-       activate_page(page);
 out:
        pte_unmap_unlock(pte, ptl);
        if (page != swapcache) {
@@ -2437,7 +2431,7 @@ static int setup_swap_extents(struct swap_info_struct *sis, sector_t *span)
                if (ret >= 0)
                        sis->flags |= SWP_ACTIVATED;
                if (!ret) {
-                       sis->flags |= SWP_FS;
+                       sis->flags |= SWP_FS_OPS;
                        ret = add_swap_extent(sis, 0, sis->max, 0);
                        *span = sis->pages;
                }
@@ -3348,7 +3342,7 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
        error = inode_drain_writes(inode);
        if (error) {
                inode->i_flags &= ~S_SWAPFILE;
-               goto bad_swap_unlock_inode;
+               goto free_swap_address_space;
        }
 
        mutex_lock(&swapon_mutex);
@@ -3373,6 +3367,8 @@ SYSCALL_DEFINE2(swapon, const char __user *, specialfile, int, swap_flags)
 
        error = 0;
        goto out;
+free_swap_address_space:
+       exit_swap_address_space(p->type);
 bad_swap_unlock_inode:
        inode_unlock(inode);
 bad_swap: