- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Block Device - Welcome to Distributed System Labatory EE 块设备-欢迎到分布式系统实验室EE
Block Device 黃建洲 蔡旻均 Outline Block device operations Generic block device layer Skeleton of a block device driver Reference What will we learn ? 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 Common Block Device Operations 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, }; Block Device Specific Operations Additional operations for block device only In include/linux/fs.h : struct block_device_operations { int (*open) (struct inode *, struct file *); int (*release) (struct inode *, struct file *); int (*ioctl) (struct inode *, struct file *, unsigned, unsigned long); int (*check_media_change) (kdev_t); int (*revalidate) (kdev_t); struct module *owner; }; In include/linux/blkdev.h : typedef void (request_fn_proc) (request_queue_t *q); Generic Block Device Layer Provides common functionality for all block devices in Linux Uniform interface (to file system) e.g. bread( ) block_prepare_write( ) block_read_full_page( ) ll_rw_block( ) buffer management and disk caching Block I/O requests scheduling Generates and queues actual I/O requests in a request queue (per device) Individual device driver services this queue (likely interrupt driven) Request Queue Data structure: in include/linux/blkdev.h Queue header: type request_queue_t typedef structure request_queue request_queue_t queue_head: double linked list of pending requests request_fn: pointer to request service routine Queue element: struct req
您可能关注的文档
- A Reliability Generalization of the Life Satisfaction Index一个对生活满意度指数可靠性的推广.ppt
- A quotation on Enriques我们有讹凯斯报价.ppt
- A Practical Guide to Red Hat® Linux® College Edition:一种实用指南,红帽子和# 174;Linux和# 174;大学版.ppt
- A quick reference guide to recommended limits to prevent WMSDs:一个快速参考指南推荐的限制,以防止WMSDs.ppt
- A Report Based on the Experimentation of Cooperative 一种基于协同试验报告.ppt
- a service-oriented approach for implementing an adaptation engine 为适应引擎实现面向服务的方法.ppt
- a shift from strictly institutional and traditional forms of从严格的制度和传统形式的转变.ppt
- A Simulation Model for Aircraft Maintenance in an Uncertain 一种在一个不确定的飞机维修保障仿真模型.ppt
- A somewhat disastrous start to PCN osteoporosisPCN骨质疏松症有些糟糕的开始.ppt
- A Survey Of Organic Light Emitting Diode Display Technology有机发光二极管显示技术综述.ppt
- Blind Spot & Rear End Warning System盲点&;追尾预警系统.ppt
- Blogging in China and Online Public Sphere - Digital Library博客在中国网上公共领域——数字图书馆.ppt
- Blogs and Podcasts A Crucial Combination博客和播客的一个至关重要的组合.ppt
- Blood Pressure - Interlake School Division血压茵特拉根学校分部.ppt
- Blood Pressure - One Body One Choice血压一体的一个选择.ppt
- BLOOD PRESSURE - The SC EBS血压- SC EBS.ppt
- Bloodborne Virus Transmission from Healthcare Worker to Patient血源性传播病毒的医护人员对病人.ppt
- Blue and Red Gradient - University of Wisconsin-Platteville蓝色和红色的梯度-威斯康星大学普拉特维尔.ppt
- Blue and Red Gradient - wickUP - HOME PAGE蓝色和红色的梯度wickup -首页.ppt
- BlueEyes Human-Operator Monitoring Systemblueeyes操作员监控系统.ppt
原创力文档


文档评论(0)