Operating System notes ten (file system) Video Chapter XII

12.1 File System: general introduction
file systems and file
file system: abstract system for persistent storage, on disk
file: Abstract file system data of one cell in the OS

12.2 file system functions
allocate disk space for file
management collection of files
provided they come and characteristics: protection (accessibility) reliability (persistence)

12.3 file and block
12.4 descriptor
kernel keeps track of per-process open files, and OS for each process to maintain an open file table, then this is the file descriptor table index

Meta data management to open the file:
file pointer, open the file number, file disk location, access rights

Users how to access the file
sequential access read sequentially by byte access almost all of the
random access read and write from the middle of an important but infrequently used
content-based access and find files indexed by features

Internal file structure:
unstructured word bit queue
simple record structure columns, fixed length, variable length
complex structure formatted documents executables

12.5, the directory
file system to be accessed need to mount the
file aliases
For chestnuts, this is a shortcut to the file storing the path name of another file, which is a soft link
hard link: it refers to the multiple file entries to a file

12.6 kinds of file system
disk file system database file system log file System Network / Distributed File System

Here we are talking about the realization of the file system

12.2 virtual file system
hierarchical structure of the upper virtual (logical) file system
underlying file system module specific
object of the virtual file system: abstract all different file systems
functions: to provide the same file and the file system interface
to manage all system files and associated data structures,
efficient query routines, traverse the file system
and the file system module specific interactive
virtual file system does not exist on disk, it exists in memory, when the OS is created, create a
file system data structure of the volume control block ( each file system)
file control blocks (each file)
directory node (each directory a)
these and when it enters the memory: loaded into memory when needed
the volume control block: into the memory when the file system is mounted
file the control block: enter memory when files are accessed
directory node: memory when you enter a file path traversal
12.3 data cache
block is read into memory on demand
after data blocks cached
two data cache ways: ordinary buffer cache page cache

Data structure 12.4 open files
forced and advice

12.5 file allocation
management file data space
allocation of the data block is a
contiguous allocation with a length specified start block header can not be realized easily add extensions delete function

Distribution chain
deletions easier
disadvantages: serial access, quick access can not; unreliable, once off a

Index allocation: support direct access, additions and deletions easy, but

12.6 List of free space
bitmap to represent the free space
on the disk bitmap must be kept in

Over 12.7 Disk Management RAID
12.8 disk scheduling
is to reorganize the OS level I / O requests order to effectively reduce the cost of disk access

Always choose the least seek time, then request access to far unfriendly, unfair

End Sahua?

Published 44 original articles · won praise 9 · views 3395

Guess you like

Origin blog.csdn.net/puying1/article/details/98215143