patch-2.4.0-test12 linux/mm/highmem.c
Next file: linux/mm/memory.c
Previous file: linux/mm/filemap.c
Back to the patch index
Back to the overall index
- Lines: 78
- Date:
Tue Nov 28 12:31:02 2000
- Orig file:
v2.4.0-test11/linux/mm/highmem.c
- Orig date:
Sun Nov 19 18:44:23 2000
diff -u --recursive --new-file v2.4.0-test11/linux/mm/highmem.c linux/mm/highmem.c
@@ -23,77 +23,6 @@
#include <linux/slab.h>
/*
- * Take one locked page, return another low-memory locked page.
- */
-struct page * prepare_highmem_swapout(struct page * page)
-{
- struct page *new_page;
- unsigned long regular_page;
-
- /*
- * If this is a highmem page so it can't be swapped out directly
- * otherwise the b_data buffer addresses will break
- * the lowlevel device drivers.
- */
- if (!PageHighMem(page))
- return page;
-
- /*
- * Here we break the page lock, and we split the
- * dirty page into two. We can unlock the old page,
- * and we'll now have two of them. Too bad, it would
- * have been nice to continue to potentially share
- * across a fork().
- */
- UnlockPage(page);
- regular_page = __get_free_page(GFP_ATOMIC);
- if (!regular_page)
- return NULL;
-
- copy_page((void *)regular_page, kmap(page));
- kunmap(page);
-
- /*
- * ok, we can just forget about our highmem page since
- * we stored its data into the new regular_page.
- */
- page_cache_release(page);
- new_page = virt_to_page(regular_page);
- LockPage(new_page);
- return new_page;
-}
-
-struct page * replace_with_highmem(struct page * page)
-{
- struct page *highpage;
-
- if (PageHighMem(page) || !nr_free_highpages())
- return page;
-
- highpage = alloc_page(GFP_ATOMIC|__GFP_HIGHMEM);
- if (!highpage)
- return page;
- if (!PageHighMem(highpage)) {
- page_cache_release(highpage);
- return page;
- }
-
- copy_page(kmap(highpage), page_address(page));
- kunmap(highpage);
-
- if (page->mapping)
- BUG();
-
- /*
- * We can just forget the old page since
- * we stored its data into the new highmem-page.
- */
- page_cache_release(page);
-
- return highpage;
-}
-
-/*
* Virtual_count is not a pure "count".
* 0 means that it is not mapped, and has not been mapped
* since a TLB flush - it is usable.
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)