有人可以解释如何解决这个问题吗?
1. **What is the maximum size of a file that could be handled by single indirect and double indirect?**
Block size is 2K
Address size is 4 Bytes
12 slots for direct disk blocks
One slot each for single indirect and double indirect.
_
2. **What is the maximum size of a file that could be handled by single indirect and double indirect?**
Block size is 4096 bytes can contain 1024 block references.
12 slots for direct disk blocks
One slot each for single indirect and double indirect.
我的尝试:
1.
Block size is 2K = 2**11
Address size is 4 Bytes = 2**2
in one block are (2**11/2**2)= 2**9 pointers
12 slots for direct disk blocks
One slot each for single indirect = 2**9
and double indirect. = 2**18
Maximum file size
( 12 + 2**9 + 2**18 ) * 2**11 = 2**29 ~ 536 MB
_
2.
Block size is 4096 bytes can contain 1024 block references
12 slots for direct disk blocks
One slot each for single indirect = 1024 = 2**10
and double indirect. = 1024**2 = 2**20
Maximum file size
( 12 + 2**10 + 2**20 ) * 2**12 = 2**32
( 12 + 1024 + 1024**2 ) * 4096 = ~ 4GB
我仍然不确定这是否正确以及我错在哪里
我的资料来源是:
-https://stackoverflow.com/questions/2742163/maximum-file-size-given-a-pspecial-inode-struct
-https://cis.temple.edu/~ingargio/cis307/readings/stable.html
-https://www.cs.swarthmore.edu/~kwebb/cs45/s18/09-File_Systems.pdf