tailieunhanh - Operating Systems Design and Implementation, Third Edition phần 7

Ngay sau chương này, chúng tôi sẽ trao đổi và phân trang. Trong suốt chương này, người đọc nên lưu ý rằng trao đổi và phân trang chủ yếu là hiện vật gây ra bởi tình trạng thiếu của bộ nhớ chính đủ để giữ tất cả các chương trình và dữ liệu cùng một lúc. | Simpo PDF Merge and Split Unregistered Version - http 7 find it using the normal cache mechanism. Once the block is found the bit corresponding to the freed i-node is set to 0. Zones are released from the zone bitmap in the same way. Logically when a file is to be created the file system must search through the bit-map blocks one at a time for the first free i-node. This i-node is then allocated for the new file. In fact the in-memory copy of the superblock has a field which points to the first free i-node so no search is necessary until after a node is used when the pointer must be updated to point to the new next free i-node which will often turn out to be the next one or a close one. Similarly when an i-node is freed a check is made to see if the free i-node comes before the currently-pointed-to one and the pointer is updated if necessary. If every i-node slot on the disk is full the search routine returns a 0 which is why i-node 0 is not used . so it can be used to indicate the search failed . When mkfs creates a new file system it zeroes i-node 0 and sets the lowest bit in the bitmap to 1 so the file system will never attempt to allocate it. Everything that has been said here about the i-node bitmaps also applies to the zone bitmap logically it is searched for the first free zone when space is needed but a pointer to the first free zone is maintained to eliminate most of the need for sequential searches through the bitmap. Page 554 With this background we can now explain the difference between zones and blocks. The idea behind zones is to help ensure that disk blocks that belong to the same file are located on the same cylinder to improve performance when the file is read sequentially. The approach chosen is to make it possible to allocate several blocks at a time. If for example the block size is 1 KB and the zone size is 4 KB the zone bitmap keeps track of zones not blocks. A 20-MB disk has 5K zones of 4 KB hence 5K bits in its zone map.

TỪ KHÓA LIÊN QUAN