2009-04-22 14:01:59

by Igor Zhbanov

[permalink] [raw]
Subject: Why module_exit() is void and not int? What about can_unload()?

Hello!

Sometimes module doesn't want to be unloaded. But now the only way to prevent
unloading (except hanging in module_exit()) is incrementing of module
usage count.

But sometimes module couldn't know whether it is a good time for unload,
and can check a condition only in module_exit() handler. But it is impossible
to return error (something like EAGAIN), since module_exit() is void.

Why not to have int module_exit()? Or some other way to tell the kernel
at module_exit() time that module cannot be unloaded?