1,分散/聚集(SG,scatter/gather)操作?
http://blog.chinaunix.net/space.php?uid=20774181&do=blog&id=1847063,
我不得不感叹,百度都没有站内搜索好用。多谢CUers!
2,看看内核block目录
其中,Makefile内容为:(然后就迷茫了,初始block驱动!)
- #
-
# Makefile for the kernel block layer
-
#
-
-
obj-$(CONFIG_BLOCK) := elevator.o blk-core.o blk-tag.o blk-sysfs.o \
-
blk-barrier.o blk-settings.o blk-ioc.o blk-map.o \
-
blk-exec.o blk-merge.o blk-softirq.o blk-timeout.o \
-
blk-iopoll.o blk-lib.o ioctl.o genhd.o scsi_ioctl.o
-
-
obj-$(CONFIG_BLK_DEV_BSG) += bsg.o
-
obj-$(CONFIG_BLK_CGROUP) += blk-cgroup.o
-
obj-$(CONFIG_IOSCHED_NOOP) += noop-iosched.o
-
obj-$(CONFIG_IOSCHED_DEADLINE) += deadline-iosched.o
-
obj-$(CONFIG_IOSCHED_CFQ) += cfq-iosched.o
-
-
obj-$(CONFIG_BLOCK_COMPAT) += compat_ioctl.o
-
obj-$(CONFIG_BLK_DEV_INTEGRITY) += blk-integrity.o
3,“反弹”缓冲区??
我晕,在书里找不到了。看来下次还是得记下页码。没有找到所谓的“反弹”缓冲区的感念,看来有些理解不能脱离上下文,不一定是标准的。
4,struct block_device
在源码/include/linux/fs.h中:
- struct block_device {
-
dev_t bd_dev; /* not a kdev_t - it's a search key */
-
struct inode * bd_inode; /* will die */
-
struct super_block * bd_super;
-
int bd_openers;
-
struct mutex bd_mutex; /* open/close mutex */
-
struct list_head bd_inodes;
-
void * bd_claiming;
-
void * bd_holder;
-
int bd_holders;
-
#ifdef CONFIG_SYSFS
-
struct list_head bd_holder_list;
-
#endif
-
struct block_device * bd_contains;
-
unsigned bd_block_size;
-
struct hd_struct * bd_part;
-
/* number of times partitions within this device have been opened. */
-
unsigned bd_part_count;
-
int bd_invalidated;
-
struct gendisk * bd_disk;
-
struct list_head bd_list;
-
/*
-
* Private data. You must have bd_claim'ed the block_device
-
* to use this. NOTE: bd_claim allows an owner to claim
-
* the same device multiple times, the owner must take special
-
* care to not mess up bd_private for that case.
-
*/
-
unsigned long bd_private;
-
-
/* The counter of freeze processes */
-
int bd_fsfreeze_count;
-
/* Mutex for freeze */
-
struct mutex bd_fsfreeze_mutex;
-
};
5,drivers/block/floppy.c
6,inode, vnode, blocks???
这个帖子还不错!
难道对于Unix系列的操作系统,大多都有v节点。但是对于linux来说,只有通用的i节点,却没有v节点吗???
7,书内vmem_disk的驱动????
#遗留问题啊~~~~
8,硬盘基本知识(磁道、扇区、柱面、磁头数、簇、MBR、DBR)?
9,块设备的读写,核心是“请求处理函数 和 请求'制造'函数”?
那么块设备的读写是怎么完成的呢?靠映射,由内核其它部分来处理……真心没有搞懂!
阅读(1376) | 评论(0) | 转发(0) |