Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Oct 2010 13:13:02 +0000 (UTC)
From:      David Xu <davidxu@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r213515 - stable/7/sys/kern
Message-ID:  <201010071313.o97DD2vD042123@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: davidxu
Date: Thu Oct  7 13:13:02 2010
New Revision: 213515
URL: http://svn.freebsd.org/changeset/base/213515

Log:
  MFC r213258:
  - kern_sched_rr_get_interval should return interval for thread 1 in
        target process.
  - eliminate a goto.

Modified:
  stable/7/sys/kern/p1003_1b.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/kern/p1003_1b.c
==============================================================================
--- stable/7/sys/kern/p1003_1b.c	Thu Oct  7 12:58:09 2010	(r213514)
+++ stable/7/sys/kern/p1003_1b.c	Thu Oct  7 13:13:02 2010	(r213515)
@@ -219,10 +219,8 @@ sched_getscheduler(struct thread *td, st
 		PROC_LOCK(targetp);
 	} else {
 		targetp = pfind(uap->pid);
-		if (targetp == NULL) {
-			e = ESRCH;
-			goto done2;
-		}
+		if (targetp == NULL)
+			return (ESRCH);
 		targettd = FIRST_THREAD_IN_PROC(targetp); /* XXXKSE */
 	}
 
@@ -233,7 +231,6 @@ sched_getscheduler(struct thread *td, st
 	}
 	PROC_UNLOCK(targetp);
 
-done2:
 	return (e);
 }
 
@@ -293,13 +290,10 @@ kern_sched_rr_get_interval(struct thread
 		targetp = td->td_proc;
 		PROC_LOCK(targetp);
 	} else {
-		targetp = td->td_proc;
-		PROC_LOCK(targetp);
-		targettd = thread_find(targetp, pid);
-		if (targettd == NULL) {
-			PROC_UNLOCK(targetp);
+		targetp = pfind(pid);
+		if (targetp == NULL)
 			return (ESRCH);
-		}
+		targettd = FIRST_THREAD_IN_PROC(targetp);
 	}
 
 	e = p_cansee(td, targetp);



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