I'm new to Freebsd and interested in system programming. So I'have picked
up a task from the project ideas list to start with.
(part of) the subject is : "This task is to define and implement a general
mechanism for tracking these references and use them in handling module
So, to do that, I've added an "int dynrefs" in struct module
(kern_module.c), and functions to increase or decrease this count
(module_add/remove_dynrefs(const char * modname) and
module_updatedynrefs(const char * modname, int action) ) in kern_module.c.
To avoid unload of a module which has a dynrefs count != 0 , I have
modified module_unload(), so that unload is process only if dynrefs=0
module_unload(module_t mod, int flags)
- error = MOD_EVENT(mod, MOD_QUIESCE);
+ (mod->dynrefs == 0) ? (error = MOD_EVENT(mod, MOD_QUIESCE)) : (error = EPERM);
I have compiled and tested. with a 6-2 RELEASE. For the test I'have used
two dummy module, one adding a dynrefs on the other.
Any comment are welcome
Fix: Patch attached with submission follows:
It is quite a long time. What was in fact needed ?
Need to see if this is something that we in fact want.
kmacy has asked for all of his PRs to be reassigned, put back into the
To submitter: I'm afraid that I don't know the status of this idea -
it may be worth posting to freebsd-hackers to give your patch a
For bugs matching the following criteria:
Status: In Progress Changed: (is less than) 2014-06-01
Reset to default assignee and clear in-progress tags.
Mail being skipped