[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Help with writing a new "fuser"
Hello all, I hope this is the proper group. Here's where I need
direction.
I want to write a new "fuser", which makes direct kernel table calls, rather
than what the current "fuser" does, which seems to be a file-tree-walk on
/proc. We've found that on a heavily loaded system, the current "fuser" is
far too slow and can actually have a serious performance impact.
Here's my ideas sofar.
Loop through the kernel task list, and for each task, lookup its file
information. For each file structure, do a string compare with the desired
file name. If a match, then print to stdout, the PID.
While I have coded in C, I have extremely limited experience with the Linux
kernel and I have no idea where to start. If pointed in a general
direction, I should be able to ask more informed questions. At this point,
I don't know what libraries to include, what kernel structures to access or
how to access them.
Thanks much,
greg
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/