开发者

reading and writing from a file in linux kernel

开发者 https://www.devze.com 2023-03-26 04:28 出处:网络
I\'m writing a patch for VFS FAT implmentation on kernel 3.0 I want to add posix attributes to FAT files that are created in linux.

I'm writing a patch for VFS FAT implmentation on kernel 3.0 I want to add posix attributes to FAT files that are created in linux. to achive that, I must save a file that contains all the relevant information on the mounted drive.

I know that reading and writing files from kernel space is something normally shouldn't be done, and I'm looking for another way to read/write the data.

I sa开发者_Go百科w articles on the net that suggested to use /proc or to create a userspace daemon that will do the IO for me. I wanted to know if anyone saw or know where can I look at an implmentation of a thing like that,because I didn't find any examples for that over the net. I'm not looking for a read/write to proc example, I want to see an entire solution for this issue.


Have a look at the quota implementation; this is a mechanism (ok, presumably not available on vfat) which reads/writes files from the kernel.

Additionally, the "loop" block device is another example of a kernel facility which does file IO.

0

精彩评论

暂无评论...
验证码 换一张
取 消