patch-2.1.37 linux/fs/proc/mem.c

Next file: linux/fs/proc/root.c
Previous file: linux/fs/proc/link.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/fs/proc/mem.c linux/fs/proc/mem.c
@@ -55,16 +55,10 @@
 	struct task_struct * tsk = current;
 
 	if (pid != tsk->pid) {
-		int i;
-		tsk = NULL;
-		for (i = 1 ; i < NR_TASKS ; i++)
-			if (task[i] && task[i]->pid == pid) {
-				tsk = task[i];
-				break;
-			}
-		/*
-		 * allow accesses only under the same circumstances
-		 * that we would allow ptrace to work
+		tsk = find_task_by_pid(pid);
+
+		/* Allow accesses only under the same circumstances
+		 * that we would allow ptrace to work.
 		 */
 		if (tsk) {
 			if (!(tsk->flags & PF_PTRACED)
@@ -291,10 +285,10 @@
 			return -ENOMEM;
 
 		if (!pte_present(*src_table))
-			do_no_page(tsk, src_vma, stmp, 1);
+			handle_mm_fault(src_vma, stmp, 1);
 
 		if ((vma->vm_flags & VM_WRITE) && !pte_write(*src_table))
-			do_wp_page(tsk, src_vma, stmp, 1);
+			handle_mm_fault(src_vma, stmp, 1);
 
 		set_pte(src_table, pte_mkdirty(*src_table));
 		set_pte(dest_table, *src_table);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov