X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Fvmscan.c;h=135bf8ca96ee60ac78783caac94fa30f2bfabfc8;hb=e82b3aec8d508d2a925a4c766e97f16b7c4dfb1b;hp=843c87d1e61f5f63e68aa53a903567a3802958f8;hpb=83928e17b92b7a667bfe674f1b330619adc2ac88;p=linux-2.6 diff --git a/mm/vmscan.c b/mm/vmscan.c index 843c87d1e6..135bf8ca96 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -417,7 +417,9 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc) * Anonymous process memory has backing store? * Try to allocate it some swap space here. */ - if (PageAnon(page) && !PageSwapCache(page) && sc->may_swap) { + if (PageAnon(page) && !PageSwapCache(page)) { + if (!sc->may_swap) + goto keep_locked; if (!add_to_swap(page)) goto activate_locked; } @@ -519,7 +521,7 @@ static int shrink_list(struct list_head *page_list, struct scan_control *sc) #ifdef CONFIG_SWAP if (PageSwapCache(page)) { - swp_entry_t swap = { .val = page->private }; + swp_entry_t swap = { .val = page_private(page) }; __delete_from_swap_cache(page); write_unlock_irq(&mapping->tree_lock); swap_free(swap);