Messages in this thread | | | Subject | Re: /proc parent &proc_root == NULL? | From | Valdis.Kletnieks@vt ... | Date | Thu, 27 Jan 2005 01:53:57 -0500 |
| |
On Thu, 27 Jan 2005 01:40:12 EST, Valdis.Kletnieks@vt.edu said:
> You may want to use a properly timed initcall() to create a callback that > happens after proc_misc_init() happens, but before userspace gets going, and > walk through the /proc tree at that time and cache info on the files you care > about, so you don't have to re-walk /proc every time permission() gets called
Blarg.
The proper time to walk the /proc filesystem and cache such info, is, of course, in the ->sp_post_addmount() LSM hook. Check @mnt and @mountpoint_nd to see if it's /proc, and if so, go snarf all the info you need to make your tests fast..
Not sure if you'd need to redo your cache in sp_post_remount(), for the odd case where /proc gets remounted....
[unhandled content-type:application/pgp-signature] | |