On Tue, 2006-04-18 at 14:39 -0700, Chandra Seetharaman wrote:
> On Tue, 2006-04-18 at 13:57 -0700, Matt Helsley wrote:
> 
> > > > > +void ckrm_get_controller(struct ckrm_controller *ctlr)
> > > > > +{
> > > > > +     struct ckrm_controller *tmp = 
> > > > > ckrm_get_controller_by_id(ctlr->ctlr_id);
> > > > > +     BUG_ON(tmp != ctlr);
> > > > > +}
> > > > 
> > > > Why isn't this just an atomic_inc()? If you've already got the
> > > > controller pointer then you have at least one reference to it already --
> > > > no need to grab the controllers lock to get another reference.
> > > 
> > > we want to make sure that the controller _is_ in our array.
> > 
> >     The fact that we already have gotten the reference to it indicates that
> > it is in the array. The only other way anyone outside core could get a
> 
> not necessarily. In this function all you know is somebody provided you
> with the controller data structure. 

        I forgot to mention that I looked at all of the callers and each of
them has a reference to a registered controller by the time they call
this function -- so this is not a problem.

<snip>

Cheers,
        -Matt Helsley



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to