patch-2.1.4 linux/mm/memory.c
Next file: linux/mm/mlock.c
Previous file: linux/mm/filemap.c
Back to the patch index
Back to the overall index
- Lines: 35
- Date:
Mon Oct 14 11:52:00 1996
- Orig file:
v2.1.3/linux/mm/memory.c
- Orig date:
Thu Oct 10 19:10:57 1996
diff -u --recursive --new-file v2.1.3/linux/mm/memory.c linux/mm/memory.c
@@ -58,13 +58,13 @@
* a common occurrence (no need to read the page to know
* that it's zero - better for the cache and memory subsystem).
*/
-static inline void copy_page(unsigned long from, unsigned long to)
+static inline void copy_cow_page(unsigned long from, unsigned long to)
{
if (from == ZERO_PAGE) {
- memset((void *) to, 0, PAGE_SIZE);
+ clear_page(to);
return;
}
- memcpy((void *) to, (void *) from, PAGE_SIZE);
+ copy_page(to, from);
}
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
@@ -636,7 +636,7 @@
if (new_page) {
if (PageReserved(mem_map + MAP_NR(old_page)))
++vma->vm_mm->rss;
- copy_page(old_page,new_page);
+ copy_cow_page(old_page,new_page);
flush_page_to_ram(old_page);
flush_page_to_ram(new_page);
flush_cache_page(vma, address);
@@ -850,7 +850,7 @@
unsigned long page = __get_free_page(GFP_KERNEL);
if (!page)
goto sigbus;
- memset((void *) page, 0, PAGE_SIZE);
+ clear_page(page);
entry = pte_mkwrite(pte_mkdirty(mk_pte(page, vma->vm_page_prot)));
vma->vm_mm->rss++;
tsk->min_flt++;
FUNET's LINUX-ADM group, [email protected]
TCL-scripts by Sam Shen, [email protected]