[openib-general] Loading / unloading IB modules

Christoph Hellwig
Mon Mar 29 09:27:41 PST 2004


On Mon, Mar 29, 2004 at 09:16:23AM -0800, Roland Dreier wrote:
> Unfortunately 2.4 doesn't have try_module_get et al., so this will be
> at least somewhat racy.  However it should fix module unloading in
> most circumstances.

static inline int try_module_get(struct module *module)
{
        if (module && !try_inc_mod_count(module))
                return 0;
        return 1;
}

static inline void module_put(struct module *module)
{
        if (module)
                __MOD_DEC_USE_COUNT(module);
}


-- 
To unsubscribe send an email with subject unsubscribe to openib-general at openib.org.
Please contact moderator at openib.org for questions.




More information about the openib-general mailing list