Hệ điều hành - Chapter 6: File systems

With CPUs faster, memory larger disk caches can also be larger increasing number of read requests can come from cache thus, most disk accesses will be writes LFS Strategy structures entire disk as a log have all writes initially buffered in memory periodically write these to the end of the disk log when file opened, locate i-node, then find blocks

ppt46 trang | Chia sẻ: nguyenlam99 | Lượt xem: 946 | Lượt tải: 0download
Bạn đang xem trước 20 trang tài liệu Hệ điều hành - Chapter 6: File systems, để xem tài liệu hoàn chỉnh bạn click vào nút DOWNLOAD ở trên
File SystemsChapter 66.1 Files 6.2 Directories 6.3 File system implementation 6.4 Example file systems 1Long-term Information StorageMust store large amounts of dataInformation stored must survive the termination of the process using itMultiple processes must be able to access the information concurrently2File NamingTypical file extensions.3File StructureThree kinds of filesbyte sequencerecord sequencetree4File Types(a) An executable file (b) An archive5File AccessSequential accessread all bytes/records from the beginningcannot jump around, could rewind or back upconvenient when medium was mag tapeRandom accessbytes/records read in any orderessential for data base systemsread can be move file marker (seek), then read or read and then move file marker6File AttributesPossible file attributes7File OperationsCreateDeleteOpenCloseReadWriteAppendSeekGet attributesSet AttributesRename8An Example Program Using File System Calls (1/2)9An Example Program Using File System Calls (2/2)10Memory-Mapped Files(a) Segmented process before mapping files into its address space(b) Process after mapping existing file abc into one segment creating new segment for xyz11Directories Single-Level Directory SystemsA single level directory systemcontains 4 filesowned by 3 different people, A, B, and C12Two-level Directory SystemsLetters indicate owners of the directories and files13Hierarchical Directory SystemsA hierarchical directory system14A UNIX directory treePath Names15Directory OperationsCreateDeleteOpendirClosedirReaddirRenameLinkUnlink16File System ImplementationA possible file system layout17Implementing Files (1)(a) Contiguous allocation of disk space for 7 files(b) State of the disk after files D and E have been removed18Implementing Files (2)Storing a file as a linked list of disk blocks19Implementing Files (3)Linked list allocation using a file allocation table in RAM20Implementing Files (4)An example i-node21Implementing Directories (1)(a) A simple directoryfixed size entriesdisk addresses and attributes in directory entry(b) Directory in which each entry just refers to an i-node22Implementing Directories (2)Two ways of handling long file names in directory(a) In-line(b) In a heap23Shared Files (1)File system containing a shared file24Shared Files (2)(a) Situation prior to linking(b) After the link is created(c)After the original owner removes the file25Disk Space Management (1)Dark line (left hand scale) gives data rate of a diskDotted line (right hand scale) gives disk space efficiencyAll files 2KBBlock size26Disk Space Management (2)(a) Storing the free list on a linked list(b) A bit map27Disk Space Management (3)(a) Almost-full block of pointers to free disk blocks in RAM- three blocks of pointers on disk(b) Result of freeing a 3-block file(c) Alternative strategy for handling 3 free blocks- shaded entries are pointers to free disk blocks28Disk Space Management (4)Quotas for keeping track of each user’s disk use29File System Reliability (1)A file system to be dumpedsquares are directories, circles are filesshaded items, modified since last dumpeach directory & file labeled by i-node numberFile that hasnot changed30File System Reliability (2)Bit maps used by the logical dumping algorithm31File System Reliability (3)File system states(a) consistent(b) missing block(c) duplicate block in free list(d) duplicate data block32File System Performance (1)The block cache data structures33File System Performance (2)I-nodes placed at the start of the diskDisk divided into cylinder groupseach with its own blocks and i-nodes34Log-Structured File SystemsWith CPUs faster, memory largerdisk caches can also be largerincreasing number of read requests can come from cachethus, most disk accesses will be writesLFS Strategy structures entire disk as a loghave all writes initially buffered in memoryperiodically write these to the end of the disk logwhen file opened, locate i-node, then find blocks35Example File Systems CD-ROM File SystemsThe ISO 9660 directory entry36The CP/M File System (1)Memory layout of CP/M37The CP/M File System (2)The CP/M directory entry format38The MS-DOS File System (1)The MS-DOS directory entry39The MS-DOS File System (2)Maximum partition for different block sizesThe empty boxes represent forbidden combinations40The Windows 98 File System (1)The extended MOS-DOS directory entry used in Windows 98Bytes41The Windows 98 File System (2)An entry for (part of) a long file name in Windows 98BytesChecksum42The Windows 98 File System (3)An example of how a long name is stored in Windows 9843The UNIX V7 File System (1)A UNIX V7 directory entry44The UNIX V7 File System (2)A UNIX i-node45The UNIX V7 File System (3)The steps in looking up /usr/ast/mbox46

Các file đính kèm theo tài liệu này:

  • pptoperating_system_chapter_06_3172.ppt
Tài liệu liên quan