svn commit: r243142 - in head/sys: fs/nfsclient kern sys

Konstantin Belousov kostikbel at gmail.com
Sun Nov 25 16:22:01 UTC 2012


On Sat, Nov 24, 2012 at 11:24:08PM +0100, Pawel Jakub Dawidek wrote:
> On Fri, Nov 16, 2012 at 08:25:06AM +0000, Konstantin Belousov wrote:
> > Author: kib
> > Date: Fri Nov 16 08:25:06 2012
> > New Revision: 243142
> > URL: http://svnweb.freebsd.org/changeset/base/243142
> > 
> > Log:
> >   In pget(9), if PGET_NOTWEXIT flag is not specified, also search the
> >   zombie list for the pid. This allows several kern.proc sysctls to
> >   report useful information for zombies.
> >   
> >   Hold the allproc_lock around all searches instead of relocking it.
> >   Remove private pfind_locked() from the new nfs client code.
> >   
> >   Requested and reviewed by:	pjd
> >   Tested by:	pho
> >   MFC after:	3 weeks
> [...]
> > @@ -364,12 +374,16 @@ pget(pid_t pid, int flags, struct proc *
> >  	struct proc *p;
> >  	int error;
> >  
> > +	sx_slock(&allproc_lock);
> >  	if (pid <= PID_MAX)
> > -		p = pfind(pid);
> > +		p = pfind_locked(pid);
> >  	else if ((flags & PGET_NOTID) == 0)
> > -		p = pfind_tid(pid);
> > +		p = pfind_tid_locked(pid);
> >  	else
> >  		p = NULL;
> > +	if (p == NULL && (flags & PGET_NOTWEXIT) == 0)
> > +		p = zpfind_locked(pid);
> > +	sx_sunlock(&allproc_lock);
> >  	if (p == NULL)
> >  		return (ESRCH);
> 
> I think we should move zpfind_locked() under 'pid <= PID_MAX':
> 
> 	sx_slock(&allproc_lock);
> 	if (pid <= PID_MAX) {
> 		p = pfind_locked(pid);
> 		if (p == NULL && (flags & PGET_NOTWEXIT) == 0)
> 			p = zpfind_locked(pid);
> 	} else if ((flags & PGET_NOTID) == 0) {
> 		p = pfind_tid_locked(pid);
> 	} else {
> 		p = NULL;
> 	}
> 	sx_sunlock(&allproc_lock);
> 	if (p == NULL)
> 		return (ESRCH);
> 

Yes, I agree. Please remove {} for one-line blocks.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20121125/6a1e9867/attachment.sig>


More information about the svn-src-all mailing list