patch-2.1.30 linux/kernel/time.c

Next file: linux/mm/filemap.c
Previous file: linux/kernel/sys.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/kernel/time.c linux/kernel/time.c
@@ -91,11 +91,6 @@
 		return -EPERM;
 	if (get_user(value, tptr))
 		return -EFAULT;
-	/*
-	 *	SMP: We need to lock out everything for the time update
-	 *	the new cli/sti semantics will let us drop this lock soon.
-	 */
-	lock_kernel();
 	cli();
 	xtime.tv_sec = value;
 	xtime.tv_usec = 0;
@@ -103,7 +98,6 @@
 	time_maxerror = MAXPHASE;
 	time_esterror = MAXPHASE;
 	sti();
-	unlock_kernel();
 	return 0;
 }
 
@@ -111,23 +105,17 @@
 
 asmlinkage int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
 {
-	int err = -EFAULT;
-
-	lock_kernel();
 	if (tv) {
 		struct timeval ktv;
 		do_gettimeofday(&ktv);
 		if (copy_to_user(tv, &ktv, sizeof(ktv)))
-			goto out;
+			return -EFAULT;
 	}
 	if (tz) {
 		if (copy_to_user(tz, &sys_tz, sizeof(sys_tz)))
-			goto out;
+			return -EFAULT;
 	}
-	err = 0;
-out:
-	unlock_kernel();
-	return err;
+	return 0;
 }
 
 /*

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