On Mon, 29 Nov 2004 15:01:48 PST, Greg KH wrote:
> On Mon, Nov 29, 2004 at 10:50:39AM -0800, Gerrit Huizenga wrote:
> > +static spinlock_t stub_lock = SPIN_LOCK_UNLOCKED;
> > +
> > +static get_ref_t real_get_ref = NULL;
> > +static put_ref_t real_put_ref = NULL;
> > +
> > +void ckrm_numtasks_register(get_ref_t gr, put_ref_t pr)
> > +{
> > + spin_lock(&stub_lock);
> > + real_get_ref = gr;
> > + real_put_ref = pr;
> > + spin_unlock(&stub_lock);
> > +}
> > +
> > +int numtasks_get_ref(void *arg, int force)
> > +{
> > + int ret = 1;
> > + spin_lock(&stub_lock);
> > + if (real_get_ref) {
> > + ret = (*real_get_ref) (arg, force);
> > + }
> > + spin_unlock(&stub_lock);
> > + return ret;
> > +}
> > +
> > +void numtasks_put_ref(void *arg)
> > +{
> > + spin_lock(&stub_lock);
> > + if (real_put_ref) {
> > + (*real_put_ref) (arg);
> > + }
> > + spin_unlock(&stub_lock);
> > +}
> > +
> > +EXPORT_SYMBOL(ckrm_numtasks_register);
> > +EXPORT_SYMBOL(numtasks_get_ref);
> > +EXPORT_SYMBOL(numtasks_put_ref);
>
> Why are these functions used instead of calling the real functions?
> They are only ever used to register a single set of functions anyway.
The real functions are dummy's by default and can be loaded by
a module.
> Oh, and void * is to be avoided at all costs...
Fixed.
thanks,
gerrit
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech