Quoting r. Sean Hefty <[EMAIL PROTECTED]>:
> Subject: Re: Re: RFC: revert module ref counting patches
> 
> Michael S. Tsirkin wrote:
> >BTW, how about the trick of exporting 
> >module_mutex_lock/module_mutex_unlock?
> >Its a really simple approach - do you think this will be acceptable?
> 
> Who exports these calls, and who calls them?

The idea is to add this to kernel/module.c:

void module_mutex_lock(void)
{
        down(&module_mutex);
}

void module_mutex_unlock(void)
{
        up(&module_mutex);
}

EXPORT_SYMBOL_GPL(module_mutex_lock);
EXPORT_SYMBOL_GPL(module_mutex_unlock);


----------------------

And now ib_sa can just

        module_mutex_lock()
        query->callback(..)
        module_mutex_unlock()

to prevent modules from unloading while callback is in progress.

Same for other modules that use callbacks without registration, like ib_addr.

-- 
MST
_______________________________________________
openib-general mailing list
[email protected]
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to