title: Read/write files within a Linux kernel module
body: <p>I know all the discussions about why one should not read/write files from kernel, instead how to use <em>/proc</em> or <em>netlink</em> to do that. I want to read/write anyway. I have also read 
  <a href="http://www.linuxjournal.com/article/8110" rel="noreferrer">Driving Me Nuts - Things You Never Should Do in the Kernel</a>.</p>
  
  <p>However, the problem is that 2.6.30 does not export <code>sys_read()</code>. Rather it's wrapped in <code>SYSCALL_DEFINE3</code>. So if I use it in my module, I get the following warnings:</p>
  
  <pre><code>WARNING: "sys_read" [xxx.ko] undefined!
  WARNING: "sys_open" [xxx.ko] undefined!
  </code></pre>
  
  <p>Obviously <code>insmod</code> cannot load the module because linking does not happen correctly.</p>
  
  <p>Questions:</p>
  
  <ul>
  <li>How to read/write within kernel after 2.6.22 (where <code>sys_read()</code>/<code>sys_open()</code> are not exported)?</li>
  <li>In general, how to use system calls wrapped in macro <code>SYSCALL_DEFINEn()</code> from within the kernel?</li>
  </ul>