svn commit: r263704 - head/sys/kern

Mateusz Guzik mjguzik at gmail.com
Tue Mar 25 23:26:55 UTC 2014


On Tue, Mar 25, 2014 at 08:03:13AM -0600, Warner Losh wrote:
> On Mar 24, 2014, at 9:28 PM, Mateusz Guzik <mjg at FreeBSD.org> wrote:
> > Author: mjg
> > Date: Tue Mar 25 03:28:58 2014
> > New Revision: 263704
> > URL: http://svnweb.freebsd.org/changeset/base/263704
> > 
> > Log:
> >  Make /dev/devctl mpsafe.
> > 
> >  MFC after:	1 week
> > 
> > static int sysctl_devctl_disable(SYSCTL_HANDLER_ARGS);
> > /* XXX Need to support old-style tunable hw.bus.devctl_disable" */
> > -SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW, NULL,
> > -    0, sysctl_devctl_disable, "I", "devctl disable -- deprecated");
> > +SYSCTL_PROC(_hw_bus, OID_AUTO, devctl_disable, CTLTYPE_INT | CTLFLAG_RW |
> > +    CTLFLAG_MPSAFE, NULL, 0, sysctl_devctl_disable, "I",
> > +    "devctl disable -- deprecated”);
> 
> This can likely be deleted now...
> 

http://svnweb.freebsd.org/changeset/base/263754

> > @@ -420,23 +420,31 @@ devinit(void)
> > static int
> > devopen(struct cdev *dev, int oflags, int devtype, struct thread *td)
> > {
> > +
> > 	if (devsoftc.inuse)
> > 		return (EBUSY);
> 
> Why not delete these two lines? Since this isn’t a performance critical part of the code,
> it is clearer and safer to just test inuse inside the locked section.
> 

http://svnweb.freebsd.org/changeset/base/263753

-- 
Mateusz Guzik <mjguzik gmail.com>


More information about the svn-src-all mailing list