Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2016 10:06:24 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r304844 - stable/11/sys/kern
Message-ID:  <201608261006.u7QA6OfX048955@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Aug 26 10:06:24 2016
New Revision: 304844
URL: https://svnweb.freebsd.org/changeset/base/304844

Log:
  MFC r303388:
  Remove Giant from settime().

Modified:
  stable/11/sys/kern/kern_time.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/kern/kern_time.c
==============================================================================
--- stable/11/sys/kern/kern_time.c	Fri Aug 26 10:04:10 2016	(r304843)
+++ stable/11/sys/kern/kern_time.c	Fri Aug 26 10:06:24 2016	(r304844)
@@ -120,9 +120,7 @@ settime(struct thread *td, struct timeva
 	struct timeval delta, tv1, tv2;
 	static struct timeval maxtime, laststep;
 	struct timespec ts;
-	int s;
 
-	s = splclock();
 	microtime(&tv1);
 	delta = *tv;
 	timevalsub(&delta, &tv1);
@@ -152,10 +150,8 @@ settime(struct thread *td, struct timeva
 				printf("Time adjustment clamped to -1 second\n");
 			}
 		} else {
-			if (tv1.tv_sec == laststep.tv_sec) {
-				splx(s);
+			if (tv1.tv_sec == laststep.tv_sec)
 				return (EPERM);
-			}
 			if (delta.tv_sec > 1) {
 				tv->tv_sec = tv1.tv_sec + 1;
 				printf("Time adjustment clamped to +1 second\n");
@@ -166,10 +162,8 @@ settime(struct thread *td, struct timeva
 
 	ts.tv_sec = tv->tv_sec;
 	ts.tv_nsec = tv->tv_usec * 1000;
-	mtx_lock(&Giant);
 	tc_setclock(&ts);
 	resettodr();
-	mtx_unlock(&Giant);
 	return (0);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608261006.u7QA6OfX048955>