Skip to content
Advertisement

where is the __init function of ext4?

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.

Advertisement

Answer

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 __initmethod 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).

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement