]> Pileus Git - ~andy/linux/blobdiff - mm/swapfile.c
mm: direct IO starvation improvement
[~andy/linux] / mm / swapfile.c
index 6a078557306a8a0e381c04fa75752e33ad72d01d..f28745855772506fb34ed19252e130343daeb532 100644 (file)
@@ -571,13 +571,13 @@ int try_to_free_swap(struct page *page)
  * Free the swap entry like above, but also try to
  * free the page cache entry if it is the last user.
  */
-void free_swap_and_cache(swp_entry_t entry)
+int free_swap_and_cache(swp_entry_t entry)
 {
-       struct swap_info_struct * p;
+       struct swap_info_struct *p;
        struct page *page = NULL;
 
        if (is_migration_entry(entry))
-               return;
+               return 1;
 
        p = swap_info_get(entry);
        if (p) {
@@ -603,6 +603,7 @@ void free_swap_and_cache(swp_entry_t entry)
                unlock_page(page);
                page_cache_release(page);
        }
+       return p != NULL;
 }
 
 #ifdef CONFIG_HIBERNATION
@@ -1851,7 +1852,6 @@ asmlinkage long sys_swapon(const char __user * specialfile, int swap_flags)
 
        if (blk_queue_nonrot(bdev_get_queue(p->bdev))) {
                p->flags |= SWP_SOLIDSTATE;
-               srandom32((u32)get_seconds());
                p->cluster_next = 1 + (random32() % p->highest_bit);
        }
        if (discard_swap(p) == 0)