patch-2.2.0-pre8 linux/arch/i386/kernel/process.c

Next file: linux/arch/i386/lib/checksum.S
Previous file: linux/arch/i386/kernel/head.S
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.0-pre7/linux/arch/i386/kernel/process.c linux/arch/i386/kernel/process.c
@@ -475,24 +475,27 @@
 
 void release_segments(struct mm_struct *mm)
 {
-	/* forget local segments */
-	__asm__ __volatile__("movl %w0,%%fs ; movl %w0,%%gs"
-		: /* no outputs */
-		: "r" (0));
 	if (mm->segments) {
 		void * ldt = mm->segments;
-
-		/*
-		 * Get the LDT entry from init_task.
-		 */
-		current->tss.ldt = _LDT(0);
-		load_ldt(0);
-
 		mm->segments = NULL;
 		vfree(ldt);
 	}
 }
 
+void forget_segments(void)
+{
+	/* forget local segments */
+	__asm__ __volatile__("movl %w0,%%fs ; movl %w0,%%gs"
+		: /* no outputs */
+		: "r" (0));
+
+	/*
+	 * Get the LDT entry from init_task.
+	 */
+	current->tss.ldt = _LDT(0);
+	load_ldt(0);
+}
+
 /*
  * Create a kernel thread
  */
@@ -778,21 +781,7 @@
 	newsp = regs.ecx;
 	if (!newsp)
 		newsp = regs.esp;
-	return do_fork(clone_flags & ~CLONE_VFORK, newsp, &regs);
-}
-
-asmlinkage int sys_vfork(struct pt_regs regs)
-{
-	int child;
-	struct semaphore sem = MUTEX_LOCKED;
-
-	current->vfork_sem = &sem;
-	child = do_fork(CLONE_VFORK | CLONE_VM | SIGCHLD, regs.esp, &regs);
-
-	if (child > 0)
-		down(&sem);
-
-	return child;
+	return do_fork(clone_flags, newsp, &regs);
 }
 
 /*

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