mirror of https://github.com/dynup/kpatch
063e9a62f5
The kpatch_internal struct is a good idea, in that it documents which parts of kpatch_module shouldn't be used by the patch module. But it creates extra code and will require more extra code if we want to keep a list of kpmods, which is needed to create a module notifier for module patching of future loaded modules. Embedding the private data directly in the public struct allows the code to be simpler: no extra kmallocs/kfrees, no need to store pointers between the public and private structs. I think the simpler code is worth the tradeoff (exposing implementation detail). Kernel code usually doesn't bother with hiding a internal struct data from other kernel code anyway. For example, see ftrace_ops or struct kprobe. The private fields are documented with a "private" comment. |
||
---|---|---|
.. | ||
core | ||
patch | ||
Makefile |