try_module_get和module_put
try_module_get注解: 1>位置:/linux/kernel/module.c
2>声明:static inline int try_module_get(structmodule *module)
3>功能:判断module模块是否处于活动状态,然后通过local_inc()宏将该模块的引用计数加14>返回值:
linux-2.6中返回值是一个整数,如果该模块处于活动状态且对它引用计数加1操作正确则返回1,否则返回0
linux-3.7.5中返回值是一个bool量,正确返回true,错误返回false!
实现方式Linux-2.6[root@root hello模块]# Message from syslogd@localhost at Feb 2 09:07:45 ... kernel:module_refcount(module):1Message from syslogd@localhost at Feb 2 09:07:45 ... kernel:module_refcount(module):2 Message from syslogd@localhost at Feb 2 09:07:45 ... kernel:module_refcount(module):1