中科大操作系统原理与实现课件11_FS Implementation1.pdf
《中科大操作系统原理与实现课件11_FS Implementation1.pdf》由会员分享,可在线阅读,更多相关《中科大操作系统原理与实现课件11_FS Implementation1.pdf(42页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、.操作系统原理与设计第11章文件系统的实现1陈香兰中国科学技术大学计算机学院2009年09月01日.提纲File-System StructureFS ImplementationDirectory ImplementationAllocation MethodsFree-Space Management小结和作业.File-System Structure IIFile structureILogical storage unitICollection of related informationIFile system resides on secondary storage(disks)
2、IFile system organizationIHow the file system should look to the userIHow to map the logical file system onto the physicalsecondary-storage devicesIFile system organized into layersILayered File System.File-System Structure II.FS Implementation IIstructures and operations used to implement file syst
3、emoperation,OS-&FS-dependmentIon-disk structuresIin-memory structuresIon-disk structuresIboot control blockIto boot an OS from the partition(volume)Iif empty,no OS is contained on the partitionIvolume control blockIdirectory structureIper-file FCB.FS Implementation IIIin-memory informationIused for
4、both FS management and performence improvementvia cachingIdata are loaded at mount time and discarded at dismountIstructures include:Iin-memory mount tableIin-memory directory-structure cacheIsystem-wide open-file tableIper-process open-file table.In-Memory File System Structures.FCBIA Typical File
5、Control Blockfile permissionsfile dates(create,access,write)file owner,group,ACLfile sizefile data blocks or pointers to file data blocks.partitions and mountingIpartitionIraw(E.g.UNIX swap space&some database)VS.cookedIboot information,with its own formatIboot imageIboot loader unstanding multiple
6、FSes&OSesdual-bootIroot partition is mounted at boot timeIothers can be automatically mounted at boot or manuallymounted later.Virtual File SystemsIVirtual File Systems(VFS)provide an object-oriented way ofimplementing file systems.IVFS allows the same system call interface(the API)to beused for dif
7、ferent types of file systems.IThe API is to the VFS interface,rather than any specific typeof file system.ISchematic View of Virtual File System.Directory ImplementationILinear list of file names with pointer to the data blocks.Isimple to programItime-consuming to executeIHash Table linear list with
8、 hash data structure.Idecreases directory search timeIcollisions situations where two file names hash to the samelocationIFixed&variable size or chained-overflow hash table.Allocation MethodsIAn allocation method refers tohow disk blocks are allocated for filesso thatdisk space is utilized effective
9、ly&files can be accessed quickly1.Contiguous allocation2.Linked allocation3.Indexed allocation4.Combined.1.Contiguous Allocation IIEach file occupies a set of contiguous blocks on the diskISimple directory entry only needIstarting location(block#)I&length(number of blocks)IMapping from logical to ph
10、ysicalLogicalAddress/512=Q.RBlock to be accessed=Q+starting addressDisplacement into block=R.1.Contiguous Allocation II.1.Contiguous Allocation IIIIAdvantages:ISupport both random&sequential accessIStart block:b;Logical block number:iphysical block number:b+iIFast access speed,because of short head
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 中科大操作系统原理与实现课件11_FS Implementation1 中科大 操作系统 原理 实现 课件 11 _FS
限制150内