作者assassin88 (背水一戰)
看板Grad-ProbAsk
標題Re: [理工] [OS]i-node size 計算
時間Mon Mar 22 21:11:49 2010
※ 引述《ie925155 (天佑台灣!)》之銘言:
: Given a UNIX i-node with either direct blocks and three levels of indirect
: blocks(ie single, double, triple) and assuming that the sizes of a pointer and a block are, respectly,
: 8 bytes and 8K bytes, answer the following questions.
: 最大的size是多少
: 請問怎麼算??
: 解答是(8 + 1K + 1M + 1G)*8K bytes
: 看不出個所以然
我猜你題目漏打原node內有幾個direct blocks,
照你的答案看來應該是8個,外加三個indirect blocks。
8Kb/8k = 1K // single indirect
1K * 1K = 1M // double indirect (因為每個indirect block皆可接
single indirect block)
同理 1M * 1M = 1G // triple indirect
=> ( 8 + 1K + 1M + 1G ) * 8Kb
--
歡迎參觀 :)
我的露天拍賣: http://class.ruten.com.tw/user/index00.php?s=outdoorsell
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.57.78.115
推 ie925155:請問8Kb/8 = 1K // single indirect 這算出來是指?? 03/22 21:18
→ assassin88:因為pointer大小為8b 03/22 21:20
推 dendrobium:他把 eight 打成 either ... 03/22 21:23
推 ie925155:為什麼要block 去除 pointer??除出來是代表什麼阿?? 03/22 21:24
→ dendrobium:有多少pointer 03/22 21:25
推 ie925155:懂了 謝謝大家 03/22 21:39
推 w8formePlz:那請問最小要怎麼算? 03/22 22:33
推 ggyyalex:最小就用掉一個BLOCK 03/22 23:41