LTHDH TH05 FileSys2 v3
LTHDH TH05 FileSys2 v3
Bài tập ebook: 11.1, 11.3, 11.4, 11.6, 11.10, 11.15 (page 499 – 502)
Câu 11.1: In what situations would using memory as a RAM disk be more useful than
using it as a disk cache?
Câu 11.3: Some file systems allow disk storage to be allocated at different levels of
granularity. For instance, a file system could allocate 4 KB of disk space as a single 4-KB
block or as eight 512-byte blocks. How could we take advantage of this flexibility to
improve performance? What modifications would have to be made to the free-space
management scheme in order to support this feature?
Câu 11.4: What are the advantages of the variant of linked allocation that uses a FAT to
chain together the blocks of a file?
Câu 11.6: Consider a file system that uses inodes to represent files. Disk blocks are 8 KB
in size, and a pointer to a disk block requires 4 bytes. This file system has 12 direct disk
blocks, as well as single, double, and triple indirect disk blocks. What is the maximum
size of a file that can be stored in this file system?
Câu 11.10: Consider a file system on a disk that has both logical and physical block sizes
of 512 bytes. Assume that the information about each file is already in memory. For each
of the three allocation strategies (contiguous, linked, and indexed), answer these
questions:
a. How is the logical-to-physical address mapping accomplished in this system?
(For the indexed allocation, assume that a file is always less than 512 blocks long.)
b. If we are currently at logical block 10 (the last block accessed was block 10)
and want to access logical block 4, how many physical blocks must be read from the
disk?
Câu 11.15: One problem with contiguous allocation is that the user must preallo-cate
enough space for each file. If the file grows to be larger than the space allocated for it,
special actions must be taken. One solution to this problem is to define a file structure
consisting of an initial contiguous area (of a specified size). If this area is filled, the
operating system automatically defines an overflow area that is linked to the initial
contiguous area. If the overflow area is filled, another overflow area is allocated.
Compare this implementation of a file with the standard contiguous and linked
implementations.