📜  门| GATE-CS-2004 |第 49 题

📅  最后修改于: 2021-09-25 06:36:48             🧑  作者: Mango

一个 Unix 风格的 i-node 有 10 个直接指针和一个单指针、一个双指针和一个三重间接指针。磁盘块大小为 1 KB,磁盘块地址为 32 位,使用 48 位整数。最大可能的文件大小是多少?
(A) 2 24字节
(B) 2 32字节
(C) 2 34字节
(D) 2 48字节答案: (C)
解释: 尼克块
图片来源:维基

Size of Disk Block = 1Kbyte

Disk Blocks address = 32bits, 
but 48 bit integers are used for address
Therefore address size = 6 bytes
                    

No of addresses per block = 1024/6  = 170.66 
Therefore 170 ≈ 2^8 addresses per block can be stored

Maximum File Size = 10 Direct + 1 Single Indirect + 
                    1 Double Indirect + 1 Triple Indirect
                 = 10 + 28 + 28*28 + 28*28*28
                 ≈ 224 Blocks

Since each block is of size 210                 

Maximum files size = 224 * 210     
                   = 234    

这个问题的测验