Date: Thu, 7 Oct 2010 12:20:50 +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-8@freebsd.org Subject: svn commit: r213511 - stable/8/sys/kern Message-ID: <201010071220.o97CKo0U040658@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: davidxu Date: Thu Oct 7 12:20:50 2010 New Revision: 213511 URL: http://svn.freebsd.org/changeset/base/213511 Log: MFC r213258: - kern_sched_rr_get_interval should return interval for thread 1 in target process. - eliminate a goto. Modified: stable/8/sys/kern/p1003_1b.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/p1003_1b.c ============================================================================== --- stable/8/sys/kern/p1003_1b.c Thu Oct 7 09:30:35 2010 (r213510) +++ stable/8/sys/kern/p1003_1b.c Thu Oct 7 12:20:50 2010 (r213511) @@ -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); } @@ -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?201010071220.o97CKo0U040658>