Hi All,
I was reading a chapter from LDD3 and came know that
file_operations->owner field is a pointer to the module that owns the file_operations structure. This field is used to prevent the module from being unloaded while its operation is in use. Almost all the time, it is simply initialized to THIS_MODULE, a macro define in <linux/module.h>
I want to know how the owner field is used to prevent from module unloading, how exactly it is used.
Till now what I was knowing is ==> there is some module usage count which is incremented for every module usage. If the count is non-zero then that means the module is in use but, I am not getting how the owner field could be used to achieve the same effect.
Please educate. Or else can someone tell me the source file name where I can search for the same information, may be the name of the file which implements the rmmod functionality.
Any help will be appreciated.
Thanks and Regards,
Prasad.