I'm struggling to understand how to use in the proper way the
try_module_get()
I found this interesting post: How to put a check in the code to ensure the inter kernel module dependency - Linux Kernel?
But I miss one point: I can get the request_module
working, but I don' get how to use the try_module_get
I explain:
If I use
ret = request_module("ipt_conntrack")
the module xt_conntrack is correctly inserted, but marked as no used, because accordingly to the above post I didn't used the try_module_get
.
But how can I call the try_module_get
? The function requires a struct module
parameter, which I don't know how to populate for the xt_conntrack module. I found several examples, but all related to the "THIS_MODULE" parameter, which does not apply in this case.
Can you point me in the right direction for this?
Thanks for your help
Perhaps something like this would work. I haven't tested it.