<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Jul 19, 2013 at 1:33 PM, SandeepKsinha <span dir="ltr"><<a href="mailto:sandeepksinha@gmail.com" target="_blank">sandeepksinha@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br><br><div class="gmail_quote"><div class="im">On Fri, Jul 19, 2013 at 1:29 PM, Saket Sinha <span dir="ltr"><<a href="mailto:saket.sinha89@gmail.com" target="_blank">saket.sinha89@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div> We all know that system-calls are for user-space.</div><div>I have a file-system driver where I have to use system calls in kernel-space.</div>
<div><br></div><div> Normally, we DON'T do any high level IOs from Kernel space (file creation/reading, and so on). But here in my driver I am stacking FS drivers, I can't avoid this. This is partly because Linux kernel can't handle FS stacking (this wouldn't be an issue for Windows, for instance, which supports stacking),</div>
<div><br></div></div></div></blockquote><div><br></div></div><div>Provide complete context of what you are trying to do. </div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<div dir="ltr"><div style="font-family:arial,sans-serif;font-size:13px"><div></div><div>The simple (and legal) way to create a dir/file whatever is to call system calls, like, for instance sys_mkdir. The problem is that I am not in a context where I can call these. Because they expect a call from user mode, while I am in kernel mode. This is even why I implemented macros such as: <a href="https://github.com/HeisSpiter/hepunion/blob/master/fs/hepunion/hepunion.h#L399" target="_blank">https://github.com/HeisSpiter/hepunion/blob/master/fs/hepunion/hepunion.h#L399</a>. This one disables all checks from user mode calls, since I am in kernel. And this allows calling system calls.</div>
<div><br></div><div> This is not a good way so is there any alternative.<br></div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Regards,</div>
<div style="font-family:arial,sans-serif;font-size:13px">Saket Sinha</div></div>
<br></div>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org" target="_blank">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>Regards,<br>Sandeep.<br><br><br><br><br><br> <br>“To learn is to change. Education is a process that changes the learner.”
</font></span><br>_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
<br></blockquote></div>Hi Saket,<br><br></div><div class="gmail_extra">fs stacking is possible in linux also, see stackable file systems for linux. Main research was done at Stony Brook by Prof. Erez Zadok. Search for fs known as wrapfs, which implements bare minimum infrastructure to do this. Also, there are examples of this in linux, go through ecryptfs. I think unionfs also does the same thing.<br>
<br></div><div class="gmail_extra">- Rohan<br></div></div>