没有合适的资源?快使用搜索试试~ 我知道了~
首页Linux 块设备 文件系统构架
资源详情
资源评论
资源推荐

Q36921204 黃建洲
Q36921115 蔡旻均


From this report, we learn
The details of how a block device works
ll_rw_block() : trigger I/O transfer
__make_request (): make request -> request queue
task queue : plug/unplug use the mechanism
request service routine :
How to write a block device driver
writing a module
Init / exit
implement the necessary operations
block_device_operations
request_fn_proc

In fs/block_dev.c
struct file_operations def_blk_fops = {
open: blkdev_open,
release: blkdev_close,
llseek: block_llseek,
read: generic_file_read,
write: generic_file_write,
mmap: generic_file_mmap,
fsync: block_fsync,
ioctl: blkdev_ioctl,
};

File system
struct le_operations def_blk_fops = {
open: blkdev_open,
release: blkdev_close,
llseek: block_llseek,
read: generic_le_read,
write: generic_le_write,
mmap: generic_le_mmap,
fsync: block_fsync,
ioctl: blkdev_ioctl,
};
Generic block device layer
Block device driver
struct block_device_operations xxx_fops =
{ open: xxx_open,
release: xxx_release,
ioctl: xxx_ioctl,
};
open( )
open( )
Character device driver
struct le_operations xxx_fops = {
llseek: xxx_llseek,
read: xxx_read,
write: xxx_write,
ioctl: xxx_ioctl,
open: xxx_open,
release: xxx_release,
};
剩余33页未读,继续阅读













安全验证
文档复制为VIP权益,开通VIP直接复制

评论3