mm: replace __get_cpu_var uses with this_cpu_ptr
[sfrench/cifs-2.6.git] / mm / swap.c
index 9ce43ba4498bee042934f484d40f2b7f2fcf48ce..913b99dfbea5985918917b1b82e05bf324e86fad 100644 (file)
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -441,7 +441,7 @@ void rotate_reclaimable_page(struct page *page)
 
                page_cache_get(page);
                local_irq_save(flags);
-               pvec = &__get_cpu_var(lru_rotate_pvecs);
+               pvec = this_cpu_ptr(&lru_rotate_pvecs);
                if (!pagevec_add(pvec, page))
                        pagevec_move_tail(pvec);
                local_irq_restore(flags);
@@ -582,13 +582,7 @@ void mark_page_accessed(struct page *page)
 }
 EXPORT_SYMBOL(mark_page_accessed);
 
-/*
- * Queue the page for addition to the LRU via pagevec. The decision on whether
- * to add the page to the [in]active [file|anon] list is deferred until the
- * pagevec is drained. This gives a chance for the caller of __lru_cache_add()
- * have the page added to the active list using mark_page_accessed().
- */
-void __lru_cache_add(struct page *page)
+static void __lru_cache_add(struct page *page)
 {
        struct pagevec *pvec = &get_cpu_var(lru_add_pvec);
 
@@ -598,11 +592,32 @@ void __lru_cache_add(struct page *page)
        pagevec_add(pvec, page);
        put_cpu_var(lru_add_pvec);
 }
-EXPORT_SYMBOL(__lru_cache_add);
+
+/**
+ * lru_cache_add: add a page to the page lists
+ * @page: the page to add
+ */
+void lru_cache_add_anon(struct page *page)
+{
+       ClearPageActive(page);
+       __lru_cache_add(page);
+}
+
+void lru_cache_add_file(struct page *page)
+{
+       ClearPageActive(page);
+       __lru_cache_add(page);
+}
+EXPORT_SYMBOL(lru_cache_add_file);
 
 /**
  * lru_cache_add - add a page to a page list
  * @page: the page to be added to the LRU.
+ *
+ * Queue the page for addition to the LRU via pagevec. The decision on whether
+ * to add the page to the [in]active [file|anon] list is deferred until the
+ * pagevec is drained. This gives a chance for the caller of lru_cache_add()
+ * have the page added to the active list using mark_page_accessed().
  */
 void lru_cache_add(struct page *page)
 {