ath5k: fix NULL pointer in antenna configuration
[safe/jmp/linux-2.6] / mm / swap.c
index bede23c..7cd60bf 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -30,6 +30,7 @@
 #include <linux/notifier.h>
 #include <linux/backing-dev.h>
 #include <linux/memcontrol.h>
+#include <linux/gfp.h>
 
 #include "internal.h"
 
@@ -55,7 +56,7 @@ static void __page_cache_release(struct page *page)
                del_page_from_lru(zone, page);
                spin_unlock_irqrestore(&zone->lru_lock, flags);
        }
-       free_hot_page(page);
+       free_hot_cold_page(page, 0);
 }
 
 static void put_compound_page(struct page *page)
@@ -118,7 +119,7 @@ static void pagevec_move_tail(struct pagevec *pvec)
                        spin_lock(&zone->lru_lock);
                }
                if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {
-                       int lru = page_is_file_cache(page);
+                       int lru = page_lru_base_type(page);
                        list_move_tail(&page->lru, &zone->lru[lru].list);
                        pgmoved++;
                }
@@ -181,7 +182,7 @@ void activate_page(struct page *page)
        spin_lock_irq(&zone->lru_lock);
        if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) {
                int file = page_is_file_cache(page);
-               int lru = LRU_BASE + file;
+               int lru = page_lru_base_type(page);
                del_page_from_lru_list(zone, page, lru);
 
                SetPageActive(page);
@@ -189,7 +190,7 @@ void activate_page(struct page *page)
                add_page_to_lru_list(zone, page, lru);
                __count_vm_event(PGACTIVATE);
 
-               update_page_reclaim_stat(zone, page, !!file, 1);
+               update_page_reclaim_stat(zone, page, file, 1);
        }
        spin_unlock_irq(&zone->lru_lock);
 }
@@ -491,55 +492,12 @@ unsigned pagevec_lookup_tag(struct pagevec *pvec, struct address_space *mapping,
 
 EXPORT_SYMBOL(pagevec_lookup_tag);
 
-#ifdef CONFIG_SMP
-/*
- * We tolerate a little inaccuracy to avoid ping-ponging the counter between
- * CPUs
- */
-#define ACCT_THRESHOLD max(16, NR_CPUS * 2)
-
-static DEFINE_PER_CPU(long, committed_space);
-
-void vm_acct_memory(long pages)
-{
-       long *local;
-
-       preempt_disable();
-       local = &__get_cpu_var(committed_space);
-       *local += pages;
-       if (*local > ACCT_THRESHOLD || *local < -ACCT_THRESHOLD) {
-               atomic_long_add(*local, &vm_committed_space);
-               *local = 0;
-       }
-       preempt_enable();
-}
-
-#ifdef CONFIG_HOTPLUG_CPU
-
-/* Drop the CPU's cached committed space back into the central pool. */
-static int cpu_swap_callback(struct notifier_block *nfb,
-                            unsigned long action,
-                            void *hcpu)
-{
-       long *committed;
-
-       committed = &per_cpu(committed_space, (long)hcpu);
-       if (action == CPU_DEAD || action == CPU_DEAD_FROZEN) {
-               atomic_long_add(*committed, &vm_committed_space);
-               *committed = 0;
-               drain_cpu_pagevecs((long)hcpu);
-       }
-       return NOTIFY_OK;
-}
-#endif /* CONFIG_HOTPLUG_CPU */
-#endif /* CONFIG_SMP */
-
 /*
  * Perform any setup for the swap system
  */
 void __init swap_setup(void)
 {
-       unsigned long megs = num_physpages >> (20 - PAGE_SHIFT);
+       unsigned long megs = totalram_pages >> (20 - PAGE_SHIFT);
 
 #ifdef CONFIG_SWAP
        bdi_init(swapper_space.backing_dev_info);
@@ -554,7 +512,4 @@ void __init swap_setup(void)
         * Right now other parts of the system means that we
         * _really_ don't want to cluster much more
         */
-#ifdef CONFIG_HOTPLUG_CPU
-       hotcpu_notifier(cpu_swap_callback, 0);
-#endif
 }