title: Dynamically create proc directory entries?
body: <p>I'm looking for a way to dynamically generate the contents of a directory in the /proc filesystem from a kernel module. This is definitely possible since the root /proc directory does it for each running process (and, indeed, that's actually what I want: to have one directory per PID inside of my /proc subdirectory – I'm trying to create a structure like <code>/proc/mymodule/&lt;tgid&gt;/&lt;pid&gt;</code>). However, the code that does this for the root <code>/proc</code> directory (found in <code>fs/proc/base.c</code>) is fairly complicated, and involves keeping an inode cache etc. Furthermore, none of the helper functions used in <code>fs/proc/base.c</code> are exported, so I'd have to copy &amp; paste them into my module.</p>
  
  <p>Is there any supported interface for dynamically generating the contents of a <code>/proc</code> directory whenever <code>readdir</code> is called?</p>