Task Control Groups: make cpusets a client of cgroups
[pandora-kernel.git] / mm / swapfile.c
index b9fc0e5..f071648 100644 (file)
@@ -425,7 +425,7 @@ void free_swap_and_cache(swp_entry_t entry)
        }
 }
 
-#ifdef CONFIG_SOFTWARE_SUSPEND
+#ifdef CONFIG_HIBERNATION
 /*
  * Find the swap type that corresponds to given device (if any).
  *
@@ -434,7 +434,7 @@ void free_swap_and_cache(swp_entry_t entry)
  *
  * This is needed for the suspend to disk (aka swsusp).
  */
-int swap_type_of(dev_t device, sector_t offset)
+int swap_type_of(dev_t device, sector_t offset, struct block_device **bdev_p)
 {
        struct block_device *bdev = NULL;
        int i;
@@ -450,6 +450,9 @@ int swap_type_of(dev_t device, sector_t offset)
                        continue;
 
                if (!bdev) {
+                       if (bdev_p)
+                               *bdev_p = sis->bdev;
+
                        spin_unlock(&swap_lock);
                        return i;
                }
@@ -459,6 +462,9 @@ int swap_type_of(dev_t device, sector_t offset)
                        se = list_entry(sis->extent_list.next,
                                        struct swap_extent, list);
                        if (se->start_block == offset) {
+                               if (bdev_p)
+                                       *bdev_p = sis->bdev;
+
                                spin_unlock(&swap_lock);
                                bdput(bdev);
                                return i;
@@ -879,7 +885,7 @@ static int try_to_unuse(unsigned int type)
                /*
                 * So we could skip searching mms once swap count went
                 * to 1, we did not mark any present ptes as dirty: must
-                * mark page dirty so shrink_list will preserve it.
+                * mark page dirty so shrink_page_list will preserve it.
                 */
                SetPageDirty(page);
                unlock_page(page);
@@ -945,7 +951,7 @@ sector_t map_swap_page(struct swap_info_struct *sis, pgoff_t offset)
        }
 }
 
-#ifdef CONFIG_SOFTWARE_SUSPEND
+#ifdef CONFIG_HIBERNATION
 /*
  * Get the (PAGE_SIZE) block corresponding to given offset on the swapdev
  * corresponding to given index in swap_info (swap type).
@@ -960,7 +966,7 @@ sector_t swapdev_block(int swap_type, pgoff_t offset)
        sis = swap_info + swap_type;
        return (sis->flags & SWP_WRITEOK) ? map_swap_page(sis, offset) : 0;
 }
-#endif /* CONFIG_SOFTWARE_SUSPEND */
+#endif /* CONFIG_HIBERNATION */
 
 /*
  * Free all of a swapdev's extent information
@@ -1525,9 +1531,6 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
                error = PTR_ERR(page);
                goto bad_swap;
        }
-       wait_on_page_locked(page);
-       if (!PageUptodate(page))
-               goto bad_swap;
        kmap(page);
        swap_header = page_address(page);