Skip to contentSkip to conversation

module usage count

DISCUSSION J.Hwan Kim 3 participants 3 messages Mar 4, 2014

lore
Share & tools
lore

J.Hwan Kim

author
#0 lore raw

Hi, everyone

When I use /proc file system in communicating between kernel and user space, is the usage count of moudule automatically incremented or decremented?

I register proc file via create_proc_entry() and use .open, .close and .mmap not using .read and .write function.

Please give me any hint..

Thanks in advance

Best Regards,

J.Hwan Kim

#1 lore raw
Quoted 4 lines · J.Hwan Kim

Hi, everyone

When I use /proc file system in communicating between kernel and user

space,

Quoted 1 line

is the usage count of moudule automatically incremented or decremented?

I don't think so.

Quoted 8 lines

I register proc file via create_proc_entry() and use .open, .close and .mmap not using .read and .write function.

Please give me any hint..

Thanks in advance

You can do that by doing fops_get
Or module_get.

Quoted 9 lines

Best Regards,

J.Hwan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140304/b7da7739/attachment.html

#2 lore raw
Quoted 33 lines · Pranay Srivastava
Quoted 4 lines · J.Hwan Kim

Hi, everyone

When I use /proc file system in communicating between kernel and user

space,

Quoted 1 line

is the usage count of moudule automatically incremented or decremented?

I don't think so.

Quoted 8 lines

I register proc file via create_proc_entry() and use .open, .close and .mmap not using .read and .write function.

Please give me any hint..

Thanks in advance

You can do that by doing fops_get
Or module_get.

Quoted 9 lines

Best Regards,

J.Hwan Kim

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

Quoted 6 lines

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies at kernelnewbies.org
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

This may help.

http://stackoverflow.com/questions/448999/is-there-a-way-to-figure-out-what-is-using-a-linux-kernel-module

Signature · 5 lines
Regards,
Rishi Agrawal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140304/b28818a0/attachment.html