]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - mm/swap.c
[PATCH] m68knommu: add ColdFire 532x timer build support
[mv-sheeva.git] / mm / swap.c
index 3045a0f4c4519ac5052cbc052450dd0723056e2e..03ae2076f92fe9bd113fe55239fdcfb431cd0265 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -214,8 +214,8 @@ void fastcall __page_cache_release(struct page *page)
                struct zone *zone = page_zone(page);
 
                spin_lock_irqsave(&zone->lru_lock, flags);
-               if (!TestClearPageLRU(page))
-                       BUG();
+               BUG_ON(!PageLRU(page));
+               __ClearPageLRU(page);
                del_page_from_lru(zone, page);
                spin_unlock_irqrestore(&zone->lru_lock, flags);
        }
@@ -265,8 +265,8 @@ void release_pages(struct page **pages, int nr, int cold)
                                zone = pagezone;
                                spin_lock_irq(&zone->lru_lock);
                        }
-                       if (!TestClearPageLRU(page))
-                               BUG();
+                       BUG_ON(!PageLRU(page));
+                       __ClearPageLRU(page);
                        del_page_from_lru(zone, page);
                }
 
@@ -345,8 +345,8 @@ void __pagevec_lru_add(struct pagevec *pvec)
                        zone = pagezone;
                        spin_lock_irq(&zone->lru_lock);
                }
-               if (TestSetPageLRU(page))
-                       BUG();
+               BUG_ON(PageLRU(page));
+               SetPageLRU(page);
                add_page_to_inactive_list(zone, page);
        }
        if (zone)
@@ -372,10 +372,10 @@ void __pagevec_lru_add_active(struct pagevec *pvec)
                        zone = pagezone;
                        spin_lock_irq(&zone->lru_lock);
                }
-               if (TestSetPageLRU(page))
-                       BUG();
-               if (TestSetPageActive(page))
-                       BUG();
+               BUG_ON(PageLRU(page));
+               SetPageLRU(page);
+               BUG_ON(PageActive(page));
+               SetPageActive(page);
                add_page_to_active_list(zone, page);
        }
        if (zone)
@@ -480,48 +480,6 @@ static int cpu_swap_callback(struct notifier_block *nfb,
 #endif /* CONFIG_HOTPLUG_CPU */
 #endif /* CONFIG_SMP */
 
-#ifdef CONFIG_SMP
-void percpu_counter_mod(struct percpu_counter *fbc, long amount)
-{
-       long count;
-       long *pcount;
-       int cpu = get_cpu();
-
-       pcount = per_cpu_ptr(fbc->counters, cpu);
-       count = *pcount + amount;
-       if (count >= FBC_BATCH || count <= -FBC_BATCH) {
-               spin_lock(&fbc->lock);
-               fbc->count += count;
-               *pcount = 0;
-               spin_unlock(&fbc->lock);
-       } else {
-               *pcount = count;
-       }
-       put_cpu();
-}
-EXPORT_SYMBOL(percpu_counter_mod);
-
-/*
- * Add up all the per-cpu counts, return the result.  This is a more accurate
- * but much slower version of percpu_counter_read_positive()
- */
-long percpu_counter_sum(struct percpu_counter *fbc)
-{
-       long ret;
-       int cpu;
-
-       spin_lock(&fbc->lock);
-       ret = fbc->count;
-       for_each_cpu(cpu) {
-               long *pcount = per_cpu_ptr(fbc->counters, cpu);
-               ret += *pcount;
-       }
-       spin_unlock(&fbc->lock);
-       return ret < 0 ? 0 : ret;
-}
-EXPORT_SYMBOL(percpu_counter_sum);
-#endif
-
 /*
  * Perform any setup for the swap system
  */