proc fs questions

Greg Zornetzer (gaz@andrew.cmu.edu)
Mon, 9 Mar 1998 18:47:33 -0500 (EST)


I've been looking over the proc code for 2.1, and have a couple of
questions on function and intent.

1. 2.0 had seperate proc_register functions for proc entries that were
defined in proc_fs.h, and those that weren't. proc_register and
proc_register_dynamic. These functions were rolled into proc_register in
2.1, weren't they? Just wanted to check.

Question 2 - Let's say that I have a module that registers a proc
directory, /proc/foo. Then I register a proc file /proc/foo/blah. No
problem. Now, I should also put unregister commands in the
cleanup_module. I've been messing around with the ways of doing this, and
it appears that there are two ways of doing this - unregistering
/proc/foo/blah, then unregistering /proc/foo. Or, it seems that I can
unregister /proc/foo, and both of them will go away. Looking at the code,
though... if I do the second option, the proc entry for /proc/foo/blah
doesn't look like it gets kfree'd, causing a memory leak. I'd be happy to
fire out a patch for this as its a simple fix, but what behavior is
preferred? Should unregistering a proc directory with files silently
unregister all of the files, print out a warning, or both?
Thanks,

Greg Zornetzer - gaz+@andrew.cmu.edu
"Light shines brightest in the darkest night"
http://www.contrib.andrew.cmu.edu/~gaz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu