[Review notes] File management of the operating system

1. The logical structure of the file

1. Unstructured documents

The data inside the file is a series of binary streams or character streams, also known as stream files .

2. Structured documents

Insert picture description here
Structured files are divided into three categories: sequential files, index files, and index sequential files

Sequential file

Insert picture description here
Insert picture description here
Index file

Insert picture description here
Index file

Insert picture description here
Note: The search efficiency of multi-level index table is high

2. File directory

Insert picture description here

1. File control block

Insert picture description here

2. Directory structure

Single-level directory structure

Insert picture description here

Two-level directory structure

Insert picture description here
Multi-level directory structure

Insert picture description here
Multi-level directory structure is not easy to share files, then we introduce acyclic graph directory structure

Insert picture description here

3. Improvement of index nodes

Insert picture description here

Summary of file directory

Insert picture description here

Three, file distribution method

File block, disk block

Insert picture description here

1. Sequential distribution

Insert picture description here

Advantages: When disk blocks are read sequentially, the speed is the fastest when continuously allocated

Disadvantages:

  1. Files stored in sequence are not convenient for expansion
  2. Physically uses continuous allocation, low storage space utilization, and hard-to-use disk fragments
2. Link Assignment

Implicit link

Insert picture description here
Insert picture description here

Explicit link

Insert picture description here
Insert picture description here

3. Index allocation

Insert picture description here
When the file is expanded , just add a row of data to the index table

When a disk block cannot fit the index table of a file, we have the following three methods:

  1. Link scheme
  2. Multi-level index
  3. Mixed index

Link scheme

Insert picture description here
Multi-level index

Insert picture description here
Mixed index

Insert picture description here
Index method summary

Insert picture description here

Insert picture description here

4. File storage space management

1. Free list method

Insert picture description here

2. Free linked list method

Insert picture description here

3. Bitmap method

Insert picture description here

4. Group link method

Insert picture description here
Allocate 100 free blocks

Insert picture description here
When all the packets are full, another disk block needs to be reclaimed
Insert picture description here

Five, file sharing

1. Sharing method based on index node (hard link)

Insert picture description here
Insert picture description here

2. Sharing mode based on symbolic chain (soft link)

Insert picture description here

Six, file protection

1. Password protection

Insert picture description here

2. Encryption protection

What is saved in the system is the result of data encryption, and the original data can be seen only after decryption with a password.

Advantages: strong confidentiality, no need to store passwords in the system
Disadvantages: encryption and decryption takes time

3. Access Control

Insert picture description here
When the user of the computer a lot, you need to set the unit for access control

Insert picture description here

Guess you like

Origin blog.csdn.net/qq_42500831/article/details/108014226