mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* patch-2.4.26.bz2, it wastes unnecessary 2 TIMES get_one_pte(mm, old_addr);
@ 2004-04-14 21:14 jc-nospam
  0 siblings, 0 replies; only message in thread
From: jc-nospam @ 2004-04-14 21:14 UTC (permalink / raw)
  To: linux-kernel

Hi ;)

>From mm/mremap.c of patch-2.4.26.bz2: "It wastes unnecessary 2 TIMES
get_one_pte(mm, old_addr);"

diff -urN linux-2.4.25/mm/mremap.c linux-2.4.26/mm/mremap.c
--- linux-2.4.25/mm/mremap.c	2004-02-18 05:36:32.000000000 -0800
+++ linux-2.4.26/mm/mremap.c	2004-04-14 06:05:41.000000000 -0700
@@ -77,12 +77,16 @@
 static int move_one_page(struct mm_struct *mm, unsigned long old_addr, unsigned
long new_addr)
 {
 	int error = 0;
-	pte_t * src;
+	pte_t * src, * dst;
 
 	spin_lock(&mm->page_table_lock);
 	src = get_one_pte(mm, old_addr);
-	if (src)
-		error = copy_one_pte(mm, src, alloc_one_pte(mm, new_addr));
+	if (src) {
+		dst = alloc_one_pte(mm, new_addr);
+		src = get_one_pte(mm, old_addr);
+		if (src) 
+			error = copy_one_pte(mm, src, dst);
+	}
 	spin_unlock(&mm->page_table_lock);
 	return error;
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-04-14 21:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-14 21:14 patch-2.4.26.bz2, it wastes unnecessary 2 TIMES get_one_pte(mm, old_addr); jc-nospam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®