operatingsystem《操作系统》ch11-filesystemimplementa.ppt
《operatingsystem《操作系统》ch11-filesystemimplementa.ppt》由会员分享,可在线阅读,更多相关《operatingsystem《操作系统》ch11-filesystemimplementa.ppt(50页珍藏版)》请在三一办公上搜索。
1、Chapter 11:File System Implementation,Chapter Objectives,To describe the details of implementing local file systems and directory structuresTo describe the implementation of remote file systemsTo discuss block allocation and free-block algorithms and trade-offs,Content Overview,File-System Structure
2、File-System Implementation Directory ImplementationAllocation MethodsFree-Space Management Efficiency and PerformanceRecoveryLog-Structured File SystemsNFSExample:WAFL File System,11.1 File-System Structure,File structureLogical storage unitCollection of related informationFile system resides on sec
3、ondary storage(disks)File system organized into layersFile control block storage structure consisting of information about a file,Layered File System,11.2 A Typical File Control Block,In-Memory File System Structures,The following figure illustrates the necessary file system structures provided by t
4、he operating systems.Figure 12-3(a)refers to opening a file.Figure 12-3(b)refers to reading a file.,In-Memory File System Structures,Virtual File Systems,Virtual File Systems(VFS)provide an object-oriented way of implementing file systems.VFS allows the same system call interface(the API)to be used
5、for different types of file systems.The API is to the VFS interface,rather than any specific type of file system.,Schematic View of Virtual File System,11.3 Directory Implementation,Linear list of file names with pointer to the data blocks.simple to programtime-consuming to executeHash Table linear
6、list with hash data structure.decreases directory search timecollisions situations where two file names hash to the same locationfixed size,11.4 Allocation Methods,An allocation method refers to how disk blocks are allocated for files:Contiguous allocationLinked allocationIndexed allocation,Contiguo
7、us Allocation,Each file occupies a set of contiguous blocks on the diskSimple only starting location(block#)and length(number of blocks)are requiredRandom accessWasteful of space(dynamic storage-allocation problem)Files cannot grow,Contiguous Allocation of Disk Space,Extent-Based Systems,Many newer
8、file systems(I.e.Veritas File System)use a modified contiguous allocation schemeExtent-based file systems allocate disk blocks in extentsAn extent is a contiguous block of disksExtents are allocated for file allocationA file consists of one or more extents.,Linked Allocation,Each file is a linked li
9、st of disk blocks:blocks may be scattered anywhere on the disk.,Linked Allocation(Cont.),Simple need only starting addressFree-space management system no waste of space No random access,File-allocation table(FAT)disk-space allocation used by MS-DOS and OS/2.,Linked Allocation,File-Allocation Table,I
10、ndexed Allocation,Brings all pointers together into the index block.Logical view.,index table,Example of Indexed Allocation,Indexed Allocation(Cont.),Need index tableRandom accessDynamic access without external fragmentation,but have overhead of index block.,Indexed Allocation Mapping(Cont.),outer-i
11、ndex,index table,file,Combined Scheme:UNIX(4K bytes per block),11.5 Free-Space Management,Bit vector(n blocks),0,1,2,n-1,biti=,1 blocki free0 blocki occupied,Block number calculation,(number of bits per word)*(number of 0-value words)+offset of first 1 bit,Free-Space Management(Cont.),Bit map requir
12、es extra spaceExample:block size=212 bytesdisk size=230 bytes(1 gigabyte)n=230/212=218 bits(or 32K bytes)Easy to get contiguous files Linked list(free list)Cannot get contiguous space easilyNo waste of spaceGrouping Counting,Linked Free Space List on Disk,11.6 Efficiency and Performance,Efficiency d
13、ependent on:disk allocation and directory algorithmstypes of data kept in files directory entryPerformancedisk cache separate section of main memory for frequently used blocksfree-behind and read-ahead techniques to optimize sequential accessimprove PC performance by dedicating section of memory as
14、virtual disk,or RAM disk,Page Cache,A page cache caches pages rather than disk blocks using virtual memory techniquesMemory-mapped I/O uses a page cacheRoutine I/O through the file system uses the buffer(disk)cacheThis leads to the following figure,I/O Without a Unified Buffer Cache,Unified Buffer C
15、ache,A unified buffer cache uses the same page cache to cache both memory-mapped pages and ordinary file system I/O,I/O Using a Unified Buffer Cache,11.7 Recovery,Consistency checking compares data in directory structure with data blocks on disk,and tries to fix inconsistenciesUse system programs to
16、 back up data from disk to another storage device(floppy disk,magnetic tape,other magnetic disk,optical)Recover lost file or disk by restoring data from backup,11.8 Log Structured File Systems,Log structured(or journaling)file systems record each update to the file system as a transactionAll transac
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 操作系统 operatingsystem ch11 filesystemimplementa
链接地址:https://www.31ppt.com/p-6513289.html