Safe registration of procfs entries in LKM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I was wondering how a loadable (and specifically unloadable) kernel
module can safely provide a procfs entry.

The procfs code switched from `struct file_operations`, which has a
`struct module *owner` member to using `struct proc_ops`, which doesn't.
This member allowed the core code to `try_module_get()` the module
before calling the operation, so that we can avoid calling it if the
module is in the process of being removed and increase the module use
count to prevent the module from being unloaded while the open file
description exists.  The procfs code did previously use
`struct file_operations`, but it looks like it didn't honour this member
then.

Does this mean procfs is not meant for loadable modules?

Thanks,
Torin


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux