- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
? Linux内核具体体系结构之虚拟文件系统 收藏
此文于2009-10-23被推荐到CSDN首页如何被推荐?
Linux内核具体体系结构之虚拟文件系统
译自:《Concrete Architecture of the Linux Kernel》
作者: Waterloo, Ontario N2L 3G1 CS 746G, Winter 1998
刘建文略译(/keminlau )
3.3 Virtual File System
3.3.1 Goals
Linux被设计成支持驱动多种不同物理设备的现代操作系统。注意,即便是同一种的硬件设备也可能存在多种不同的接口,比如硬盘有PATA、SATA、SCSI、 USB等不同接口(KEMIN:注意接口与总线的区别)。除了支持不同的物理设备接口外,Linux还支持各种不同的逻辑文件系统( logical file systems),这个功能有助于Linux与其它的操作系统共存和互操作。[虚拟文件系统]泛化和囊括了[外设输入输出]和[逻辑文件系统]功能,实现以下一些“伟大”目标:
* Multiple hardware devices - provide access to many different hardware devices
* Multiple logical file systems - support many different logical file systems
* Multiple executable formats - support several different executable file formats (like a.out, ELF, java)
* Homogeneity - present a common interface to all of the logical file systems and all hardware devices
* Performance - provide high-speed access to files
* Safety - do not lose or corrupt data
* Security - restrict user access to access files; restrict user total file size with quotas
3.3.2 External Interface
[虚拟文件系统]为系统边界提供了两层的接口:对外的是给用户进程调用的系统调用(system-call);对内是给内核其它子系统调用的底层函数。
对外系统调用函数是符合POSIX标准的,包括文件操作open/close/read/write/seek/tell,和目录操作readdir/creat/unlink/chmod/stat。
对内的接口则更丰富一些,除了公开文件系统的功能函数,还会对内核其它子系统公开一些实现的数据结构。比如, inode 和 file。以下两个接口定义可在文件系统C头文件(/include/linux/fs.h)中找到:
Inode Interface:
* create(): create a file in a directory
* lookup(): find a file by name within a directory
* link() / symlink() / unlink() / readlink() / follow_link(): manage file system links
* mkdir() / rmdir(): create or remove sub-directories
* mknod(): create a directory, special file, or regular file
* readpage() / writepage(): read or write a page of physical memory to a backing store
* truncate(): set the length of a file to zero
* permission(): check to see if a user process has permission to execute an operation
* smap(): map a logical file block to a physical device sector
* bmap(): map a logical file block to a physical device block
* re
文档评论(0)