System-call in Kernel Space

Rohan Puri rohan.puri15 at gmail.com
Fri Jul 19 04:57:43 EDT 2013


On Fri, Jul 19, 2013 at 1:33 PM, SandeepKsinha <sandeepksinha at gmail.com>wrote:

>
>
> On Fri, Jul 19, 2013 at 1:29 PM, Saket Sinha <saket.sinha89 at gmail.com>wrote:
>
>>   We all know that system-calls are for user-space.
>> I have a file-system driver where I have to use system calls in
>> kernel-space.
>>
>>  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),
>>
>>
> Provide complete context of what you are trying to do.
>
>
>> 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:
>> https://github.com/HeisSpiter/hepunion/blob/master/fs/hepunion/hepunion.h#L399.
>> This one disables all checks from user mode calls, since I am in kernel.
>> And this allows calling system calls.
>>
>>  This is not a good way so is there any alternative.
>>
>> Regards,
>> Saket Sinha
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
>>
>
>
> --
> Regards,
> Sandeep.
>
>
>
>
>
>
> “To learn is to change. Education is a process that changes the learner.”
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
> Hi Saket,

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.

- Rohan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130719/74b46aec/attachment.html 


More information about the Kernelnewbies mailing list