从内核空间中的块设备读取 [英] Reading from a block device in kernel space
问题描述
我正在编写内核模块,需要从现有的块设备执行读取. (/dev/something).
I am writing a kernel module and need to perform reads from an existing block device. (/dev/something).
有人知道我可以做为参考的其他模块吗?
Does anyone know of any other modules that do these that I can use as reference ?
任何指针都将受到欢迎
(Linux.2.6.30)
(Linux.2.6.30)
推荐答案
如果您确实必须使用filp_open
,filp_close
,vfs_read
和vfs_write
函数.
If you really absolutely must then use the filp_open
, filp_close
, vfs_read
and vfs_write
functions.
针对filp_open的描述指出:如果确实需要,这是从内核空间打开文件的助手.但是通常,您不应该这样做,所以请继续前进,在这里什么也看不到."
The description for for filp_open states "This is the helper to open a file from kernelspace if you really have to. But in generally you should not do this, so please move along, nothing to see here.."
http ://www.linuxjournal.com/article/8110
这篇关于从内核空间中的块设备读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!