As every module that is to be inserted in the kernel needs an __init function. where can I find the __init function of the original ext4 module written by linus torvalds? I want to make some changes in it.
I suppose you're looking for this method : https://github.com/torvalds/linux/blob/master/fs/ext4/super.c#L5781
MODULE_ALIAS_FS("ext4");
.....
static int __init ext4_init_fs(void)
{
....
This __init
method is the main one of the module because it is defined just after the official declaration MODULE_ALIAS_FS("ext4")
which declares the fs-ext4
module.
As mentioned by @MarkPlotnick, the __init
and __exit
methods are also referenced and published as the module entry/exit funcs with the module_init(ext4_init_fs)
call (and the next one for exit).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.