資源描述:
《操作系統(tǒng)教程11.ppt》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、Chapter11:FileSystemImplementationFile-SystemStructureFile-SystemImplementationDirectoryImplementationAllocationMethodsFree-SpaceManagementEfficiencyandPerformanceRecoveryLog-StructuredFileSystemsNFSExample:WAFLFileSystemFile-SystemStructureFilesystemsallowt
2、hedata2bestored,located,retrievedeasilyDesignproblems:Howisitlook2theuserCreatingalgorithms&datastructure2mapthelogicalFSontothesecondary-storageI/Otransfersmemory?disksinunitsofblocksFilesystemorganizedintolayersFilecontrolblockstructureconsistingofinformati
3、onaboutafileOwnership,permissions,locationetc.LayeredFileSystemDevicedriversinterrupthandlersIssuesgeneralcommands:rd,wrtorganizesfiles,logical&physicalblocksTranslation,freespaceMetadataFCBATypicalFileControlBlockOn-DiskStructuresBootcontrolblock(/volume)Con
4、taininfoneeded4bootinganOSfromitbootblockinUFS,partitionbootsectorinNTFSVolumecontrolblock(/volume)Containsvolumedetails,includes:no.&sizeofblocksfree-blockcount&pointerfreeFCBcount&FCBpointerSuperblockinUFS,masterfiletableinNTFSOn-DiskStructuresDirectorystru
5、cture(/FS)ToorganizefilesIncludesfilenames&associateinodeno.inUFSstoredinmasterfiletableinNTFSFilecontrolblock(/file)inodeinUFSstoredinmasterfiletableinNTFSUsesarelationaldatabasestructure,row/fileIn-MemoryFileSystemStructuresMounttableInfoabouteachmountedvol
6、umeIn-memorydirectorystructurecacheInfoofrecentlyaccesseddirectoriesSystem-wideopen-filetableCopiesoftheFCBforallopenfile,etc.Per-processopen-filetableApointertotheappropriateentryinthesystem-wideopen-filetableIn-MemoryFileSystemStructuresVirtualFileSystemsPr
7、ovidesanO-OwayofimplementingFS2functions:Separatesthefile-system-genericoperationsfromtheirimplementationbydefiningacleanVFSinterfaceProvidesamechanismforuniquelyrepresent-ingafilethroughoutanetwork(byvnode)Allowsthesamesystemcallinterface(theAPI)tobeusedford
8、ifferenttypesofFSTheFSAPIistotheVFSinterface.SchematicViewofVirtualFileSystemVirtualFileSystemonLinuxObjectsInode-representsanindividualfileFile-representsanopenfileSuperblock-representsa