[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
题型三:混合索引
每个数据块可以指示的块数=磁盘块大小/块号大小
间接索引块数=每个数据块可以指示的块数^n级次幂
最大文件总块数=直接索引个数+一级间接索引块数+二级间接索引块数+……
最大文件字节=最大文件总块数*磁盘块大小
直接上例题:
*
某文件系统的文件目录项中有6个表目的数组用作描述文件的物理结构,该数组的前4个表目用作直接索引,第5个表目为一级间接索引,最后一个表目用作二级间接索引,磁盘块的大小为512字节,块号占2字节。请回答下列问题:
(1) 该文件系统能构造的最大文件有多少字节?
(2) 某个文件file有268KB,请画出该文件数据块的索引结构。
答:
(1) 每块512字节,块号2字节,则每个数据块可以指示256块,
则最大文件的总块数:4+256^1+256^2=65796,
(4表示前4个表目用作直接索引,除直接索引外,间接索引块数=每个数据块可以指示的块数^n级次幂)
字节数为:65796*512。
(2) 268K需占268K/512=523块,(512为磁盘块大小)
523=4+256^1+263,523在4+256^1和4+256^1+256^2之间,在所以要用到二级索引。
索引结构图:框中为文件的逻辑块号,从0开始编号
谢谢“碧桃和露”5月22号打赏给我的8毛钱
谢谢“qq_52937762”5月23号打赏给我的1.6元