{"format":"brushup-mindmap-v1","id":"os-00-sheet4","title":"文件管理","structure":"timeline-h","theme":"auto","root":{"id":"9b795769bb79592d3c519ac14c","topic":"文件管理","expanded":true,"children":[{"id":"83faca6ea8cb77c218789a694a","topic":"文件","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-78cd28a5481c37.svg"},"children":[{"id":"86e95f8c4eab2aa3849f5a7262","topic":"定义","expanded":true,"children":[{"id":"80d97e9e8a68b204e3a2b985fd","topic":"信息集合、文本文档图片程序...","expanded":true}]},{"id":"844dd36a-73c2-40bb-98d9-41a6158b391e","topic":"在用户角度中：","expanded":true,"children":[{"id":"8c8d73ef-1e9e-4215-9878-e68f343449a3","topic":"OS引入文件系统的目的是可以让用户实现按名存取","expanded":true},{"id":"7f264010-bca0-4562-898f-9b7d15367830","topic":"文件系统的设计是为了方便用户的","expanded":true}]},{"id":"cb28946031d93489e9c278fe9e","topic":"属性","expanded":true,"children":[{"id":"234ea468-49d9-472a-b7c9-aaab70e88033","topic":"又称：文件元数据","expanded":true,"style":{"background":"#FDD834"}},{"id":"6e4db1c1-2216-4743-bfc8-2164b01c15dc","topic":"名称、标志符、类型、位置、大小、保护、时间、日期、用户标识 等","expanded":true},{"id":"e3688ea0c0cae07413032b716e","topic":"文件名","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"977bfdd9d82b2ed27fa238ad87","topic":"同一目录下，文件名称唯一。是用户搜索的主要内容","expanded":true}]},{"id":"68495d2cceea8f974382ca4a81","topic":"标识符","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"06c8a61a144b77f4fe52e9e39e","topic":"每个文件都由一个的唯一标签，人不可读","expanded":true}]},{"id":"c248420e3baa590be964ba95b1","topic":"保护信息","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"ecabb471da091746d631b8de89","topic":"访问控制信息","expanded":true}]},{"id":"e1fb414b9bd9c35e22abf868f1","topic":"其他属性","expanded":true,"children":[{"id":"4799823832c8ea7aee48e90d04","topic":"类型、位置、大小、时间","expanded":true}]}]},{"id":"d007deb8-2aeb-4565-8448-56dde1351f31","topic":"文件控制块、索引节点：","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"02dafd807bbbb1121281e8c4da","topic":"结构","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7be8d73b44e9548d7dc1892272","topic":"数据项","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"73a865b1c33b52448b4c38d6c8","topic":"基本数据项","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"1569f973171bd4da11974a3ad7","topic":"原子数据，不可再分","expanded":true}]},{"id":"1bb92ba3831a1ae64e414aff8e","topic":"组合数据项","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"b24b2c9a391a92db82d358dd30","topic":"多个基本数据项组成","expanded":true}]}]},{"id":"0289bf3aa9a9c6753382988877","topic":"记录","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"8698c7c1810bdd2282970a5b33","topic":"相关的数据项的集合","expanded":true}]},{"id":"24ea39b13e5a229990d7d82e97","topic":"文件","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"2b099f541fc96312fc99fa873a","topic":"记录式文件","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"bc7acbd7d598f5a7e9729aaeae","topic":"由众多记录的集合","expanded":true}]},{"id":"e1a8cdb6017ac930d83e6960de","topic":"流式文件","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"72ba7a0ec1b91236c61a387e3e","topic":"无结构文件组成字符流","expanded":true}]}]}]},{"id":"91dbde01533bcf699a9019c2db","topic":"保护","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"35fb3f4558fb3d4e27c88a6883","topic":"口令保护","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c3ca5164550905ac3bbcb991e0","topic":"优点：","expanded":true,"children":[{"id":"836aad3f551975f834294ba219","topic":"口令开销小","expanded":true}]},{"id":"67dbecf506a9acfa08647a8f2f","topic":"缺点：","expanded":true,"children":[{"id":"972bdd92868b547692e90bf9c6","topic":"保存在内存中，很不安全","expanded":true}]}]},{"id":"7e0ad485239a3a89a39ad80293","topic":"加密保护","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"faaa8a907d2a5477d7dec8581e","topic":"优点：","expanded":true,"children":[{"id":"fc78c61b0fcb9c532fcbfb7d67","topic":"保密性强","expanded":true}]},{"id":"072b2e7554c9843ed3094b1885","topic":"缺点：","expanded":true,"children":[{"id":"ed6a031b171a22bb187a7ae7ad","topic":"编码、译码需要一定时间","expanded":true}]}]},{"id":"c68a7bbf3bea4c15dec16bb7b6","topic":"访问控制","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"aee86bbf660b53cc4e531b1174","topic":"访问控制列表：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"08688309406ac12dbea44973a2","topic":"英文：","expanded":true,"children":[{"id":"6be9f12d4ebb5d96b3571aa175","topic":"ACL","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"a4529317-31a1-498d-8a4f-7c37a95f0ee9","topic":"根据用户身份进行控制，给每个文件和目录增加ACL，规定了不同的用户的访问类型。","expanded":true},{"id":"b7f9fa700cb86831eb33882eef","topic":"【精简】的访问控制列表：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"15da136bb2ea41237895e855a6","topic":"拥有者","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"484a3da98fa95b086a7ff8a682","topic":"创建文件的用户","expanded":true}]},{"id":"bf29a3c28e988d00cf32288525","topic":"组","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"0b4990f52a79c932111d1a1941","topic":"需要共享文件且具有类似访问的用户","expanded":true}]},{"id":"3758e784ff19f5fc08e2aa17a4","topic":"其他","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"72dbb854f049b4603f577ba625","topic":"系统内的所有其他用户","expanded":true}]}]}]},{"id":"6a58f57a73db57046a675b73ce","topic":"缺点：","expanded":true,"children":[{"id":"d8686039872b05bd29adab0024","topic":"内容太多，使用精简可以解决问题","expanded":true}]},{"id":"25e7d88e-1cf6-4d1d-9989-d72c436db8c6","topic":"相比加密保护保密性更差，但更灵活","expanded":true,"style":{"background":"#FFABD5"}},{"id":"7d4c94ad-d223-480b-b3fc-61e3f26b211c","topic":"访问文件的限制因素：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"a5a456d7-10a8-4869-a5ba-6477a2c8262c","topic":"用户访问权限 + 文件属性","expanded":true,"style":{"background":"#FFABD5"}},{"id":"ab6100b4-845a-426b-9629-ad16d966dc8e","topic":"用户优先级与能否访问文件无关","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"d556f7aa-292d-441d-be3a-92585a893f2a","topic":"系统级安全管理：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"ef26ae97-0ac2-4eba-9a40-a5b19396d6e1","topic":"登录注册","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"1a0bed88-ae3c-471c-a546-0e675f842d65","topic":"文件操作","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-12567a48de67cd.svg"},"children":[{"id":"01958919-e319-4864-8720-3c640e3f5709","topic":"最后看看","expanded":true},{"id":"a159ea533268cfea82c588f9e1","topic":"创建","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"e01a4dae-0c93-4e5a-8333-7229fed138ef","topic":"从外存中找到文件对应大小的【磁盘空间】","expanded":true,"style":{"background":"#FFABD5"}},{"id":"9f3ed887-d852-4629-8ad1-c2fa706c1433","topic":"创建该文件对应的【目录项】","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"6adb64ef12091b5ffc8a891168","topic":"删除文件","expanded":true,"style":{"background":"#0CE6CF"},"children":[{"id":"49e56a71-08e2-4660-9a8d-a83dc44d0303","topic":"如果存在其他硬链接：","expanded":true,"style":{"background":"#0CE6CF"},"children":[{"id":"ecc9ad81-4fd9-476d-a291-d175a8e1d68c","topic":"修改FCB的文件链接数","expanded":true,"style":{"background":"#0CE6CF"}}]},{"id":"a7bd75db-c1c2-41e5-b614-eb995296e694","topic":"不存在硬链接：","expanded":true,"style":{"background":"#0CE6CF"},"children":[{"id":"3f1526b5-a52b-4c37-be50-19b84ca4662f","topic":"删除文件的目录项","expanded":true,"style":{"background":"#0CE6CF"}},{"id":"7e248e1d-4de8-4208-a990-dbaaad879dc5","topic":"删除该文件的FCB","expanded":true,"style":{"background":"#0CE6CF"}},{"id":"191630d6-cd48-48e2-b10f-8d27f20430e9","topic":"释放与此文件相关的内存缓冲区","expanded":true,"style":{"background":"#0CE6CF"}},{"id":"d5613bb9-6e9b-4209-94cf-24bd74d09554","topic":"回收文件磁盘空间","expanded":true,"style":{"background":"#0CE6CF"}}]}]},{"id":"bab872b835ba14e961b59bc9d2","topic":"打开(目录)文件","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"4962c768-59fc-485c-9361-509058ba3512","topic":"主要工作：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"9fe0cdc9-3e37-4aa6-872e-637187b884b5","topic":"1. 找到文件对应的目录项","expanded":true,"style":{"background":"#FFABD5"}},{"id":"f9c37935-ebe1-4a1a-b2de-fa96116e363f","topic":"2. 把目录项复制到内存中的打开文件表中","expanded":true,"style":{"background":"#FFABD5"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-dc283c8476e364.png","width":360.62,"height":208.97}},{"id":"319b4f7c-7f7d-424f-b466-371da3734b72","topic":"3. 随后用户就可以使用打开文件表中的编号来指明要操作的文件","expanded":true,"style":{"background":"#FFABD5"}},{"id":"2af7132b-ba21-41b4-80c3-28d89de01f76","topic":"把文件目录调入到内存中（调入 --- 复制到内存中）","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"f04fa036-ae1b-420a-ba5a-ac12cd9e8bb8","topic":"指令：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"60c65550-799b-40d1-bb5c-072410a54d46","topic":"open(char* path, char* fname, int access) -> int","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"1d140726-daf5-44d5-846e-55a82d01d1c8","topic":"path：文件路径","expanded":true,"style":{"background":"#FFABD5"}},{"id":"53496c03-53c1-4a25-bd4c-7dda416bde57","topic":"fname：文件名","expanded":true,"style":{"background":"#FFABD5"}},{"id":"07159ff9-0c12-4f22-8060-f39461f347f2","topic":"access：指明了是只读、只写、读和写","expanded":true},{"id":"c5055373-496b-4930-8af6-e7a05c21a86b","topic":"返回的int：文件唯一标识符fd","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"b65b8e3ed7c8d57b59ae8a7103","topic":"关闭","expanded":true,"style":{"background":"#0CE6CF"},"children":[{"id":"1cdd6e89-49f6-4a83-942b-f54d9873b03a","topic":"回收分配给文件的【内存空间】","expanded":true,"style":{"background":"#0CE6CF"}},{"id":"989832aa-a74f-4101-a36c-3ef49ee6168b","topic":"系统中的“打开文件表“中count - 1。如果count == 0，则删除对应表项","expanded":true,"style":{"background":"#0CE6CF"}}]},{"id":"3c8800738fb968ab77b91a7483","topic":"读文件","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"4b166a25-487d-4d40-8885-5f553f518ba7","topic":"通过文件的目录结构，如果找到了文件的逻辑地址（即已经在内存中了），直接访问内存","expanded":true,"style":{"background":"#FFABD5"}},{"id":"c2a42931-bd15-4532-aa02-af8bdbc96dc5","topic":"通过文件的目录结构，发现数据不在内存中，则进程进入到阻塞态，请求调页。","expanded":true,"style":{"background":"#FFABD5"}},{"id":"53180eb7-7da6-4a3a-a4de-a1da31e991c9","topic":"指令：","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"27c05fca-6e15-4bb1-85d3-42cc70f8c75d","topic":"read(int fd, int* buf, int n)","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"9039fd3f-8dc3-4e43-bdd8-cd0b74cbd06a","topic":"fd：文件唯一标识符","expanded":true,"style":{"background":"#FFABD5"}},{"id":"8516a18e-b77c-4c11-ae69-511baf0a9b49","topic":"buf：缓冲区始址","expanded":true,"style":{"background":"#FFABD5"}},{"id":"fe497668-e7a3-49d4-b1b0-665d4c73af48","topic":"n：读入的字节数","expanded":true,"style":{"background":"#FFABD5"}}]}]}]},{"id":"47b9c313ccca7108f66ed8fb1c","topic":"写","expanded":true,"style":{"background":"#0CE6CF"},"children":[{"id":"26b6cf29-73af-403d-86c5-76f6bfa4c158","topic":"找到文件、打开文件、读取文件（记事本需要显示已记录的内容）","expanded":true,"style":{"background":"#0CE6CF"}},{"id":"3907a946-edb7-4c26-bb28-0e6e02aef8e5","topic":"在内存区域中修改了文件数据后，使用write系统调用写入到磁盘中","expanded":true,"style":{"background":"#0CE6CF"}}]},{"id":"376def36-5f5a-424f-a3dc-1445c055c1ad","topic":"复制","expanded":true,"children":[{"id":"b5d93913-a8a4-46d9-93d4-426ddbe7d888","topic":"文件在同一个OS中复制时，应保证逻辑结构不变，但物理结构可变","expanded":true}]},{"id":"6828b0936bda5f0bbdb719e56e","topic":"重定位","expanded":true,"children":[{"id":"beded7f2-8fc2-4e2d-9bd0-36b2316c084e","topic":"按某条件搜索目录，将当前文件位置设为给定值，并且不会读、 写文件。","expanded":true}]},{"id":"4beb0784827bf7060f58988b5d","topic":"截断","expanded":true,"children":[{"id":"6456cf15-9494-4564-b0e3-64b6b5fbad78","topic":"允许文件所有属性不变，并删除文件内容，即将其长度设为0并释放其空间。","expanded":true}]},{"id":"05b85951-1f99-4362-9f85-7e2732256d19","topic":"提高文件访问速度","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"9bb02eb0-f9e0-46eb-9d8a-8341348a1727","topic":"下列优化方法中，可以提高文件访问速度的","expanded":true,"style":{"background":"#8EDE99"}},{"id":"a420d908-df57-40cb-b65f-9968116abdda","topic":"提前读","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"19bddae4-8e7c-45f9-a9db-ca489c5cc4b2","topic":"提前读是指在读当前盘块时，将下一个可能要 访问的盘块数据读入缓冲区，以便需要时直接从缓冲区中读取，提高了文件的访问速度","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"5a7b2724-005f-46c9-ab89-c18ccd20fbd3","topic":"为文件分配连续的簇","expanded":true,"children":[{"id":"c04a1417-5c38-4755-8331-672093c25f99","topic":"✅","expanded":true}]},{"id":"98c19640-62c3-4e25-a5b0-c5a00090f74c","topic":"延迟写","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"1f3702f6-ca31-40a7-988b-b189a606a3a1","topic":"延迟写是指先将数据写入缓冲区，并置上“延迟写\"标志，以备不久之后访问，当缓冲区需要再次 被分配出去时，才将缓冲区数据写入磁盘，减少了访问磁盘的次数，提高了文件的访问速度","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"5f9e2593-9949-4240-a189-c8ddaf819137","topic":"采用磁盘高速缓存","expanded":true,"children":[{"id":"1770a631-42a6-401d-a801-55f0c18b7880","topic":"✅","expanded":true}]}]}]},{"id":"308b616967d845df1df68b474a","topic":"文件的逻辑结构","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-feeda6963c3d0a.svg"},"children":[{"id":"a3ebcba2-191b-41d3-a9da-6efb7abe5491","topic":"文件+索引方式","expanded":true,"children":[{"id":"f26957c4-8b1d-486f-8b95-43938aeacc76","topic":"文件","expanded":true,"style":{"background":"#8EDE99","shape":"rect"},"children":[{"id":"d2c86e12-46a8-4601-8e06-bd635b67ece0","topic":"无结构","expanded":true,"style":{"background":"#8EDE99","shape":"rect"},"children":[{"id":"a320b87c-39b0-4abb-9d76-f00247bcbeed","topic":"顺序遍历","expanded":true,"style":{"shape":"pill"}}]},{"id":"6a646da1-6e15-454b-89d4-30c16b0646a9","topic":"有结构","expanded":true,"style":{"background":"#8EDE99","shape":"rect"},"children":[{"id":"88e0cb41-ed74-4b54-8e3c-361f79db9fc2","topic":"不定长","expanded":true,"style":{"background":"#8EDE99","shape":"rect"},"children":[{"id":"11f5614f-7186-4b6d-814f-3ceb1be21d87","topic":"顺序遍历","expanded":true,"style":{"shape":"pill"}}]},{"id":"53486bce-8600-486e-a753-c7ab415a2a4a","topic":"定长","expanded":true,"style":{"background":"#8EDE99","shape":"rect"},"children":[{"id":"3033e06e-b7c0-4693-b866-918c4926dd7a","topic":"链式存储","expanded":true,"style":{"background":"#8EDDF9","shape":"rect"},"children":[{"id":"3f2a1de9-4d34-4868-8b8f-fcaaf8f92645","topic":"顺序遍历","expanded":true,"style":{"shape":"pill"}}]},{"id":"a5f711d2-ec40-4f6f-90d2-5b8ba0361bab","topic":"顺序存储","expanded":true,"style":{"background":"#8EDDF9","shape":"rect"},"children":[{"id":"17c03c7b-e20d-4b38-9fa7-1bcd3936cbc9","topic":"顺序结构","expanded":true,"style":{"background":"#8EDDF9","shape":"rect"},"children":[{"id":"919d5a1b-5621-47a1-8b2a-fd3a0160e36c","topic":"以设定的关键字为key遍历","expanded":true,"style":{"shape":"pill"}}]},{"id":"a6ae278e-b78d-4386-b0c3-1123a176e2f2","topic":"串结构","expanded":true,"style":{"background":"#8EDDF9","shape":"rect"},"children":[{"id":"403842ac-a7ca-4edf-acd2-209e9e16e0f2","topic":"以时间为key遍历","expanded":true,"style":{"shape":"pill"}}]}]}]}]}]}]},{"id":"041a2430333820dcf573f82c91","topic":"无结构文件(流式文件)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a1f84d4539bbab9938f77a256b","topic":"访问记录的方法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"604a3865-78bf-44f8-8256-4ce8d2be59bd","topic":"遍历所有，找到其中一个","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"b5d972c40fead5e658fc29731b","topic":"例如：","expanded":true,"children":[{"id":"630964fedc0a0f8677accb49f8","topic":"源程序","expanded":true},{"id":"48db7327b9584e1089ebe997bf","topic":"代码文件","expanded":true},{"id":"bf286f0e7cfa530599eb09d896","topic":"txt文本","expanded":true}]}]},{"id":"4a89f8be9ffa120f1f7c5b716b","topic":"有结构文件(记录式文件)","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"375b77c81e797e341a1678ca0d","topic":"例如：","expanded":true,"children":[{"id":"7c1bc4fff1f93adc727fdbefca","topic":"数据库","expanded":true}]},{"id":"1888ee3003f870f9cbfe8b6b32","topic":"文件分类","expanded":true,"children":[{"id":"6afabc7711d8e1713de8fbf693","topic":"顺序文件","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"308a2d7e49289ba4a14c29c3bb","topic":"存储方式","expanded":true,"children":[{"id":"97eae00ed7a9645e4f2548f488","topic":"顺序存储","expanded":true,"children":[{"id":"c63f9809-c4d3-49e7-b1de-6e0751e0c225","topic":"物理上相邻","expanded":true}]},{"id":"385962168049deddf55fa9d727","topic":"链表式存储","expanded":true,"children":[{"id":"87af2e94-fef2-4d2e-b62e-f3264b1fc8dc","topic":"物理上不相邻","expanded":true}]}]},{"id":"4be83fe6a17867cfb0c3983b63","topic":"结构","expanded":true,"children":[{"id":"ca2aa00d341bb1c22e3a5b488d","topic":"顺序结构","expanded":true,"children":[{"id":"dd050403-d6c6-45ae-afbd-45d7b629dd58","topic":"以关键字为key","expanded":true}]},{"id":"05582d54f9e84d255575180c8a","topic":"串结构","expanded":true,"children":[{"id":"a3098788-2faa-4f5b-8505-525e1a6ec902","topic":"以时间为key","expanded":true}]}]},{"id":"148be0a1-94db-4622-a3f9-6398eaee51d6","topic":"最方便去支持视频文件的（视频是顺序播放的）","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"3fd88bd47d2a95e31c3d0969c2","topic":"索引文件","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2d19fcb449dbf8a835beca3db4","topic":"示意图：","expanded":true,"children":[{"id":"73f005dc-fde3-4e95-948a-d726a6fc9c75","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-95cf89d0f89f34.png","width":403,"height":194}}]},{"id":"ea6b519d8a3b00a5cbdb49b424","topic":"【索引表】的物理存储类型：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"fd9ac0d254c9a324aa58ab29bd","topic":"顺序结构、顺序存储、定长的顺序文件","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c7a3113b8b8f6a.png","width":393,"height":63}}]},{"id":"ffb2fea6-f5ff-4876-b3cd-3e2acc6cda5f","topic":"索引表项：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"03b7618a-110f-4bad-9101-de5051c41fba","topic":"索引号、长度、逻辑地址（指针）","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"df45fb9d-cec3-4cd4-b87a-cb454a1e8d4c","topic":"注意此处的指针是逻辑地址，因为是逻辑结构结构","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"94e8d509e089866da21f9b1a2c","topic":"定长/不定长：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"58f85d64f6e9b2f488d2eb239d","topic":"定长可以通过 A = i * L 来直接找到","expanded":true,"style":{"background":"#FF9595"}},{"id":"b73a0f2132e9883830a2992d3a","topic":"不定长要通过 A = ∑Li + 1来找","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"f2ac51e5-7584-4034-bc31-453545e5feff","topic":"目的：","expanded":true,"children":[{"id":"7617711b-3f59-4dea-a515-c2f73c637a89","topic":"成百上千倍提高访问speed","expanded":true}]},{"id":"cdb1316a-1c6b-4c6b-9c91-28b08763dbeb","topic":"此处也可以设计多级索引（因为是数据结构），但是书上没说过","expanded":true,"style":{"background":"#FFABD5"}}]},{"id":"c2fa97369d88d6742a93c8cdf2","topic":"索引顺序文件","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"910baae0d1fbb274735a896c8d","topic":"示意图：","expanded":true,"children":[{"id":"978b75d7-b7f4-45f9-b669-2221979df03e","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c562950f4cf902.png","width":321.54,"height":162.27}}]},{"id":"2c0b878e535a056848a919818d","topic":"前提：","expanded":true,"children":[{"id":"c73cb6e2-779a-49ef-bd88-de4c7ef919d2","topic":"顺序文件","expanded":true,"children":[{"id":"cfdc6db5-61fd-4266-9d4e-82ed8a72a328","topic":"【索引文件】中的逻辑文件可以不是顺序结构的","expanded":true,"style":{"background":"#ADADAD"}}]}]},{"id":"23f9a5136c788205c63a0b1386","topic":"索引表：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"f75ee56c-f877-420f-baa4-520713dc855b","topic":"key + 【逻辑地址】","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"903812c7b61a2a212421291e15","topic":"关键字规则：","expanded":true,"children":[{"id":"295a3e70a7cbd943b322299455","topic":"组间递增","expanded":true},{"id":"d219d931bbc8397e9557b96b2a","topic":"组内无序","expanded":true}]},{"id":"366a4f482c1b7f9e9805d9c298","topic":"如果有N条记录，那么平均查找次数的提升：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"9b5ccdf3-19a0-446a-9847-da7fde2d04d3","topic":"","expanded":true,"note":"$$ AVL从 N/2提升到\\sqrt{N} $$","style":{"background":"#FDD834"},"formula":{"tex":"AVL\\text{ 从 } N/2 \\text{ 提升到 } \\sqrt{N}","displayMode":true,"mathml":"<span class=\"katex\"><math xmlns=\"http://www.w3.org/1998/Math/MathML\" display=\"block\"><semantics><mrow><mi>A</mi><mi>V</mi><mi>L</mi><mtext> 从 </mtext><mi>N</mi><mi mathvariant=\"normal\">/</mi><mn>2</mn><mtext> 提升到 </mtext><msqrt><mi>N</mi></msqrt></mrow><annotation encoding=\"application/x-tex\">AVL\\text{ 从 } N/2 \\text{ 提升到 } \\sqrt{N}</annotation></semantics></math></span>"}}]}]},{"id":"6f988cc392e89b2ecb0fd928c5","topic":"直接文件/散列文件","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3c7a28f69ddab0de4e0849abd1","topic":"直接文件","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8cf8a363-0e56-4c9b-be5f-033248ce124d","topic":"关键字本身就含有物理地址的信息","expanded":true}]},{"id":"624b1ba87e5a35a7eedcfba5f8","topic":"哈希文件","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"e3792268-33e8-42fb-a6ee-fbde7f00d3a6","topic":"使用哈希映射能够找到对应的物理地址","expanded":true}]}]}]}]},{"id":"4c6dd5ef-55f9-4c87-a8df-c758c1219fa0","topic":"逻辑结构是用户自己定义的数据结构，和文件具体的存储方式没有半点关系，和内存管理也没有半点关系","expanded":true,"style":{"background":"#EEEEEE","shape":"rounded"}}]},{"id":"446b8962d4cb45eb13d70bdcd5","topic":"文件分配方式（物理结构）","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-84a338e255dc39.svg"},"children":[{"id":"a45ea67e-9ba3-4382-9313-064d51d05ffa","topic":"考频：超高","expanded":true,"style":{"background":"#BA69C8"},"children":[{"id":"b9dae4de-1a93-4c3a-b1e9-f7a0dbdd8251","topic":"09*2、10、12、13*3、14、15、17、18、20*2、14大、16大、18大、22大","expanded":true}]},{"id":"c29386cf-68f8-4183-baac-d342d558edbb","topic":"文件在外存中具体的存储方式（文件的物理结构）","expanded":true,"style":{"background":"#EEEEEE","shape":"rounded"}},{"id":"4a787732b2b98433bfd4a9d817","topic":"连续分配","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"025f49a5-e8b8-49ee-9e18-ccbb9166106d","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d1a7a0e8904f4e.png","width":391.42,"height":323.51}},{"id":"5e698a045d982b06265aaa3fcf","topic":"原理：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"15eb1e6e859a7733fb8768da3c","topic":"每个文件在磁盘上占有一组连续的块，在外存中是【连续分配】","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"4c792016f2ba055438d27aba16","topic":"目录表：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6c08def27c293a151d4e3a3ce7","topic":"<文件名、起始盘块号、长度>","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"3e2ac4a4fe8ba411f255e9f20b","topic":"支持的访问类型：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c5285bdee299d6792a1b5b9c5b","topic":"顺序访问、直接访问","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"1488b135e3f8d713a99c7b3833","topic":"优点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"371adaad2f6b3999c4e0cbe1e4","topic":"寻道数、寻道时间最短","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"51e876ab-8a5c-4035-bd13-1d174feda0fb","topic":"磁盘章节","expanded":true}]}]},{"id":"555bf3a7d8293f27561c4a3a70","topic":"缺点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"914a949d834b88f64fce09c54c","topic":"文件长度不可动态增加","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"12f9707965babb697126a9ef83","topic":"只适用于长度固定的文件","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"6b83b525-827b-448b-b6d5-88f34a8e1071","topic":"只有连续分配会出现碎片","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"1cc6c75f-d2d2-4ec5-8894-24f25642953f","topic":"谈速度时，连续分配不管是顺序存取还是随机存取都是最快的","expanded":true,"style":{"background":"#FFABD5"}}]}]},{"id":"adfb5a0e7a68ea353629db5cc8","topic":"链接分配","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9e4a62bdd659fedb073cb8ce38","topic":"原理：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"c54a88c9ec8963064cb15b9784","topic":"从起始盘块号开始访问，一块一块的找，采用离散分配的思路查找文件","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"2e3ae5b4710b180c2efe28f8db","topic":"支持的访问类型：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"b29ab001dc182a2b65734a98a9","topic":"顺序访问","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a6384cbf-47d9-48a7-9cf9-a81c82b76eca","topic":"不能直接访问","expanded":true}]}]},{"id":"7dd9ba1484a91f2d30e838bfbb","topic":"隐式链接","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e767bc1c-82a2-4875-a468-b613275b3730","topic":"在每一个盘块的末尾都存有一个【指向下一个盘块】的指针","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ea4c36c3d6f358.png","width":394.56,"height":324.27}},{"id":"bb09a3be34fb065fe1df88908d","topic":"目录表：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ca8a47dbe7392d57b465bae554","topic":"<文件名、起始盘块号、末尾盘块号>","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"bbf87bbb77cb8cb63f91b82b01","topic":"缺点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"52e848e5fefa3f82a75549885e","topic":"稳定性不够，容易丢失数据","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"f9db006919f853f4540b28cb2a","topic":"指针会消耗空间","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"5c6b54421f682bb7d243f9e9f1","topic":"只能顺序访问，有大量的IO，很费事","expanded":true,"style":{"background":"#FDD834"}}]}]},{"id":"7e1b392ccc1a59a7808feb73da","topic":"显式链接","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"14dabe9b-3086-4d69-92d9-a0c59ac19236","topic":"FAT表","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c8a41cb5a8b9e4.png","width":282.4,"height":245.55}},{"id":"4a6bac14ac5b00aeb20429875e","topic":"目录表：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6d2bb5024d58ae6116e2eb8c2f","topic":"文件名、起始盘块号","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"9bd81d7cdedb0004fcba79c40e","topic":"文件分配表：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b80a1e2391b8394bb2d0cb4060","topic":"英文：","expanded":true,"children":[{"id":"09eaae4e55984554ae353801dd","topic":"FAT","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"032a85da66fa69884e234a5a14","topic":"内容：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c4abffe27f181d10afc948c3b3","topic":"下一块的号码","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"775230d1-18e9-45be-b7c1-bfd6811c9a18","topic":"不存有盘块号","expanded":true}]},{"id":"502989fb96598c3d18f9c88780","topic":"如果是最后一块就是-1，如果没有被分配就是-2","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"936983e9965a8e24ec43caa09f","topic":"FAT在启动时：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"ca09440270cbe14dc4c09abeec","topic":"和文件目录表一样，刚启动就被导入内存，所以很明显的提高了检索速度","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"ce4ac6c929d8c84a83f978e193","topic":"缺点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"dfe8e34c92c9f1cc92948ad0d1","topic":"每次启动的时候都要把FAT读入内存，若FAT很大，则会占用大量的内存","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"da1ba780-db5d-4fd7-acc6-8bea0976f4e1","topic":"身兼数职，还可以负责管理磁盘的空闲空间","expanded":true,"style":{"background":"#FFABD5"},"children":[{"id":"d3b253e5-57c0-43c0-a426-0e7b1c56c7cd","topic":"磁盘章节，-2就是空闲盘块","expanded":true}]}]}]},{"id":"136b3d008cb8e5450eda4bc1b8","topic":"索引分配","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"d4521541-3b46-4d75-bf97-07cb7c2b64f1","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c8905a1b253d53.png","width":414.18,"height":315.03}},{"id":"8d8a187e0b6adad00d39e9e4ee","topic":"原理：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e449b7b310c88461208ceb68b9","topic":"【每个文件对应有一个索引表】，内存中的文件目录表存的是每个文件对应的索引表块号，当要访问一个文件的时候，首先把该文件【的索引表从外存读入内存】","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"83593001b109905defe378a50f","topic":"目录表：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"260aa81f630b1b7f397b58bb97","topic":"<文件名、索引表块号>","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"646a112137bb8993ab8438605c","topic":"索引表：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"458befbeabba488b426069d6f3","topic":"顺序地存有文件的块号","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"613b320d50590088e9298969d7","topic":"优缺点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8b1b4348173a00d2c4e918b71f","topic":"优点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c6b8cbf2c85b829a7082bb36f3","topic":"支持随机、顺序存取","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"65bac87d0f380f2d5f3cb887ef","topic":"文件拓展很方便","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"b80b7cd4d43b2523dd9cf9bb87","topic":"比起显示链接，不需要把索引表同时存入到内存中","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"8f3b06f72439a9edd922e83a31","topic":"缺点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"c009f9207cc98ef89480f99a46","topic":"如果程序很大的话，一个块大小的索引表不够用","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"45c804641ae99db6c7ee9847c0","topic":"缺点优化：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"302b75632da8122955113aa4ec","topic":"链接方案：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8ea9f9ccf0783d28571c3bc82e","topic":"如果一个块大小的索引表存不够，那么索引表最后就指向下一个索引表的块","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"3e0b65683f0a2b290092499599","topic":"多层索引：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d228052463382150f8708b3d7d","topic":"和多级页表一样，首先访问一级索引表，然后再访问二级索引表","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"71ce4d34-39fd-4c53-9af8-d3a2c498bd1f","topic":"混合索引","expanded":true,"style":{"background":"#FF9595"}}]}]},{"id":"029b0d602ad8c5a6a398cb96b8","topic":"混合索引：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a52b7743e4a9791c4728da9d9d","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-055344d652400c.png","width":366.83,"height":332.94},"children":[{"id":"17bb7a9d-fae5-40f1-97cc-878b9ec6d0fc","topic":"一个索引表中，存在","expanded":true},{"id":"d2abd519-157b-4142-a825-b81d9f245da9","topic":"1. 直接地址（直接指向一个块）","expanded":true,"children":[{"id":"d463a35e-7fff-4981-814b-58344827a8ed","topic":"i.addr(0) ~ i.addr(9)","expanded":true}]},{"id":"2000024b-327c-4e05-8843-157aaf1f5065","topic":"2. 一级间接（指向一个索引表）","expanded":true,"children":[{"id":"b23200ef-c58a-4a5b-9936-c5b402ddb134","topic":"i.addr(10)","expanded":true}]},{"id":"ae299f52-6ddd-4a7c-80a2-ebe83cee144a","topic":"3. 二级间接（指向一个二级索引表）","expanded":true}]}]},{"id":"2a99aaf8-5049-4069-bd96-6680478c0675","topic":"如果访问一个文件中第n块中的记录：","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"341a84d2-e6ec-4f8e-8c67-5245df871a2e","topic":"连续分配","expanded":true,"children":[{"id":"154728e3-e819-468e-9446-15e9b7c907a7","topic":"只需访问一次磁盘","expanded":true}]},{"id":"c02589b5-923f-4182-aef3-0a15f584f604","topic":"链接分配","expanded":true,"children":[{"id":"6ebdd704-1ccc-44cb-877c-600806291876","topic":"隐性","expanded":true,"children":[{"id":"e8c9505f-da56-432c-9c49-d418fe1c7b1f","topic":"需要访问n次磁盘","expanded":true}]},{"id":"6ccafdad-bdda-4f79-99d2-9b346a67a863","topic":"显性","expanded":true,"children":[{"id":"d4d4025b-23ac-4281-a049-e15b2dc2a9e1","topic":"需要访问1次磁盘","expanded":true}]}]},{"id":"3c9afcbe-08d7-4409-91d7-93cf4c1607e9","topic":"索引分配","expanded":true,"children":[{"id":"ad55e83b-3aa7-43a0-ab97-9facfa2497f1","topic":"访问两次磁盘（一次读索引表，一次读文件）","expanded":true},{"id":"6096bcc5-96ad-44c0-be4c-d10ca58e13bc","topic":"可能存在超过两次访问（如果索引表一块磁盘装不下）","expanded":true}]}]}]},{"id":"2168e6428a88cbd579585a5a12","topic":"文件的目录结构","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1b2d365e674989.svg"},"children":[{"id":"17d4eebc-5c5d-4431-ac89-63625b40acf6","topic":"文件目录项","expanded":true,"children":[{"id":"dd5a67c15b9ac14d4b93bb6631","topic":"文件控制块","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"52f93b1cb4197da38a36e98137","topic":"缩写","expanded":true,"children":[{"id":"65799890dfe8190be7cdc9a7e3","topic":"FCB","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"a1a9576df3ebe74cbffc2b3e3f","topic":"存储方式","expanded":true,"children":[{"id":"512a56497729ced4ec3289788c","topic":"顺序存储、顺序文件","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"15ba2d2e8fe8802b1f266ae345","topic":"包含信息","expanded":true,"children":[{"id":"ed3b5a65c32b003e266cf9c7d8","topic":"基本信息","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"6758241231f81a6089dcdbf778","topic":"文件名、物理位置、逻辑结构、物理结构","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"4b693550c71902660651f9efa0","topic":"存取信息","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7698c3862f683fe5d38d2837ab","topic":"存取权限","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"e1f835c500a9ffa86a1af91f73","topic":"使用信息","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"16ba5c42e07bbfc0084d98aff2","topic":"建立时间、修改时间","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]},{"id":"6afac0aad77a0b61a6bee9bf19","topic":"索引节点","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c10986a5d17bf1285ec80ab0fd","topic":"作用","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"2415e2c8-8ee5-4506-8b8b-6e374eb63054","topic":"用来“瘦身”","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"b2719708-3cbb-4524-ad45-1ef3cc7c4c10","topic":"存放在内存中","expanded":true},{"id":"c1d24a4b-c0a4-4501-b074-d875f4b73c36","topic":"FCB = <文件名> + <索引节点>","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"bd6acc6ffd39c0d226933aa394","topic":"因为在查找的时候只有对应文件名的目录项才有用处，所以没必要把所有FCB都读进来，用一个索引节点（指针）来代替FCB的包含信息就可以了","expanded":true}]},{"id":"b08ab1081bcb7b5fbacdbaae58","topic":"磁盘索引节点","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"771915ba84996b5b790acbfd1d","topic":"存放位置：","expanded":true,"children":[{"id":"04088efd104822ddaca7d8113d","topic":"外存中","expanded":true}]},{"id":"4baada49156bb9b36a76eb166d","topic":"每个文件的磁盘索引节点唯一","expanded":true},{"id":"7058ed80b96a949080ec986ce6","topic":"包括的内容","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"6539b6a23e8b023e256dfadc40","topic":"主标识符","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"fc6b6d3d8d5b1ae94752fb707e","topic":"拥有该文件的个人/小组标识符","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"8fe8fde28a2a8b6498ce1a1272","topic":"类型","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"f58c70e5-8f93-4e4d-91f3-a302ce8caf55","topic":"普通文件/目录文件/特别文件","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"9b2bd78fbfcacc0c93134bd87a","topic":"存取权限","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"821bb8e5-0d31-41e2-b067-867d41b9d07b","topic":"各类用户对文件的权限","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"8a48cc5be72adf989cafea2c00","topic":"物理地址","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"f158ca057e5b4e6e9a1c480b05","topic":"每个索引节点有13个地址项， iaddr(0) ~ iaddr(12)， 可以直接或间接给出数据所在盘块编号","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"c11127bd-7edf-44ed-be2f-7bf53d112e26","topic":"0~9 直接地址","expanded":true},{"id":"12e9d195-fc5e-4230-ab21-de7c2386a67a","topic":"10 一级页表","expanded":true},{"id":"48859fbd-675e-4573-8d02-586bd7cc3aa2","topic":"11 二级页表","expanded":true},{"id":"4b8904c4-24f9-4d4f-86a4-7cfc71175e2d","topic":"12 三级页表","expanded":true}]}]},{"id":"e809228e82bac9aad23ab80a2c","topic":"文件长度","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9092a27e-aa09-4277-b05b-725d22de53ab","topic":"✅","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"ca895883c6eae4e08dc2e92e87","topic":"文件链接数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"0f4b62b3160a477b12b5a8a048","topic":"所有指向该文件的指针数","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"1f7ad96232fa04297cdceacb0f","topic":"文件存取时间","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"a032d97c-6cf0-4eb9-b5bd-0bcb0a5f8204","topic":"✅","expanded":true,"style":{"background":"#8EDE99"}}]}]},{"id":"45dab584adfad0e61608a9743e","topic":"文件调入内存","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"36b1902f-abf5-4136-9a21-a51cafe033bf","topic":"文件调入前：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4313262d-ebbb-48c5-84d6-250ef1dccc7e","topic":"文件调入内存以前仅存放在磁盘中，调入内存后，复制磁盘索引节点，增加以下内容，形成了(内存)索引节点","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"733dd873-6783-4351-83d1-771683266baf","topic":"索引节点增加的内容：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"507b619fb5d9684641409938cb","topic":"索引节点编号","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"d651169d-b2a0-4a12-a316-08786ac2783d","topic":"用于标识内存的索引节点","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"5dba684f922bbb599f73682652","topic":"状态","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"da18be6391fbd9cbbe157adcb1","topic":"是否上锁/被修改","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"456b69e7333bdb7fd463b9e956","topic":"访问计数","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"8006e5dd-9a23-4a3a-8ff1-ec625ee8a801","topic":"有多少进程现在正在访问","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"833b101635b8724c3fbc7a115f","topic":"逻辑设备号","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"937b94183e09fb3aa190391a24","topic":"文件所属文件系统的逻辑设备号","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"dc4aede961790a2ba0c28a11fe","topic":"链接指针","expanded":true,"style":{"background":"#D0D0D0"},"children":[{"id":"d9d9783ad69980a988e96b9721","topic":"指向空闲链表和散列队列的指针","expanded":true,"style":{"background":"#D0D0D0"}}]}]}]},{"id":"42849f69-05a0-4aab-8573-b5c3e9ee2c66","topic":"主类存物文文文，号状访计逻设针","expanded":true,"style":{"background":"#FDD834","shape":"rect"}}]},{"id":"1e8762a1-c519-4331-b18e-932af4ea3e61","topic":"索引节点 = 磁盘索引节点 + 附加内容","expanded":true,"style":{"background":"#0CE6CF","shape":"rect"}}]}]},{"id":"21899d241b585e081948e87623","topic":"目录结构","expanded":true,"children":[{"id":"c60a35abd5299d1dcf8bc87459","topic":"（搜索、创建文件、删除文件、显示目录、修改目录）对目录结构的影响","expanded":true,"children":[{"id":"032bc6d9a8489fb111045a14a5","topic":"搜索文件时，要【查找目录】","expanded":true},{"id":"89896362171b5d99eca059249f","topic":"创建文件时【创建】对应目录项","expanded":true},{"id":"1f0a7e1761e92949b31c69600a","topic":"删除文件时【删除】对应目录项","expanded":true},{"id":"df5a953b85b93884fef03aaa3d","topic":"【显示当前界面中所有的目录项的内容】，包括文件属性...","expanded":true},{"id":"713b7c75537be0e7034e99cc20","topic":"修改文件的同时也要【修改相应的目录】","expanded":true}]},{"id":"30fa23fde37856ee4a57db7bf1","topic":"四种目录结构","expanded":true,"children":[{"id":"d90bf86aa7fbd448a226784c22","topic":"单/一级目录结构","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"e88ada3ab599db13dccb183c24","topic":"示意图：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b73209f6-8d1c-4c7d-b1b4-02e0ab1b7e68","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-8dc3c6f9a608b8.png","width":232,"height":64}}]},{"id":"d48836727dc822c0e7791ac36a","topic":"缺点：","expanded":true,"children":[{"id":"60194c059e78ad3c9ea4bb2979","topic":"不允许重名","expanded":true},{"id":"606b2045f94bdc3705132b0799","topic":"不适用于多用户","expanded":true}]}]},{"id":"2b9afd5b3d78b1d37ec5abdc7a","topic":"两级目录结构","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"31787df7b158ce162a8c884a57","topic":"示意图：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9579cb02d3db4e9775832a8ef6","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-2135f23d4e64f3.png","width":352.51,"height":116.52}},{"id":"f28a01045bb804a4f0c6bab36a","topic":"分为主文件目录、用户文件目录","expanded":true}]},{"id":"a07a025aae98834d7c9c8804b5","topic":"缺点：","expanded":true,"children":[{"id":"c1aa9acbbea836c6df3118b5e9","topic":"缺乏灵活性","expanded":true},{"id":"10b9c58b8e68ea4b10eaca804d","topic":"不能共享文件","expanded":true},{"id":"7a69883aa48b801e1d657b6ab4","topic":"不能对文件分类","expanded":true}]}]},{"id":"1488abe1866b1a506dfe2a1ba5","topic":"多级/树形目录结构","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"563a4338625ac27a2da0098b6e","topic":"示意图：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4596dd27-e7db-4555-9c88-db901dff9da3","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-17d564c9a15415.png","width":379.54,"height":174.11}}]},{"id":"bd1927e14ccb07c437d1c969ab","topic":"树形目录结构，现代OS都在用","expanded":true},{"id":"be69feec48f976731e7f792920","topic":"绝对路径、相对路径：","expanded":true,"children":[{"id":"167eb084-a37b-4a70-9cd6-5826d9604f3b","topic":"绝对路径就是从根出发的整个目录结构","expanded":true},{"id":"a84c8d37-21c7-45f6-bf8b-bc3d873a55f5","topic":"相对路径就是从当前文件夹出发的整个目录结构","expanded":true}]},{"id":"462988142c696201cacdfab8fb","topic":"缺点","expanded":true,"children":[{"id":"d94af505c74850788650483920","topic":"不能共享文件","expanded":true},{"id":"7028767ff428c2088d67e8995d","topic":"搜索路径长，增加了磁盘访问次数","expanded":true}]}]},{"id":"426b4a91a55a435bc3a7293402","topic":"无环图目录结构","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f65a30e6c81a90df4e174a49df","topic":"示意图：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a6fdc83f-a1be-49ec-8b7c-1c094b760e5c","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-ef8b6c739205ae.png","width":387.26,"height":299.96},"children":[{"id":"c34d5900-e166-4d52-b12e-fb68fceb5065","topic":"DAG图","expanded":true}]}]},{"id":"e7f88370d8cb118457b4eb4e58","topic":"共享计数器：","expanded":true,"children":[{"id":"82ea5b19f1680afcb9707beab0","topic":"每有一个进程访问该文件，计数器就++","expanded":true},{"id":"bc6af30761b8deaa6e7e8b5be0","topic":"少一个就--","expanded":true},{"id":"c8a9ce9009684c98f002983e54","topic":"=0，就退出内存","expanded":true}]}]}]}]},{"id":"1279ecc5-bf19-4cde-9dda-13b91abb27ec","topic":"目录操作","expanded":true,"children":[{"id":"7785991b-41a4-48b7-984b-f2f150daa201","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d3cf162d462d03.png","width":644,"height":251},"children":[{"id":"07d7b9b9-0a74-47cc-b64a-ddc60af83838","topic":"create","expanded":true,"children":[{"id":"6b606ecc-d1db-41da-a897-f29fd4e1f275","topic":"指明新建文件A属于哪个path(父目录B是谁)。创建后B的目录会新建一个指向A的FCB","expanded":true},{"id":"74b34e57-0d17-478e-9303-c6f6bd2d55be","topic":"create创建的初始目录中包含有. 和 .. 两个文件","expanded":true,"children":[{"id":"6b3bbdaf-3f7f-4568-bf6c-1980fcf4314c","topic":"cd ./child_file","expanded":true,"children":[{"id":"7eaa768b-c50f-49bd-98bf-6ad877274cf6","topic":". 即本文件目录","expanded":true}]},{"id":"d1faf2fa-7f89-4149-9199-327d193641b3","topic":"cd ../father_file2","expanded":true,"children":[{"id":"2014b0a1-41ef-4d26-bf0f-f2f4270a82ac","topic":".. 即父文件目录","expanded":true}]}]}]},{"id":"afaf51fa-bb25-4e37-8415-be18b953c219","topic":"delete","expanded":true,"children":[{"id":"b2872c37-95df-4c0a-af80-7de66ab635b7","topic":"删除FCB、回收空间；如果删除非空目录，则其中所有的文件都要被删除","expanded":true}]},{"id":"86394188-d0f6-419c-a4c9-7f1bfb935869","topic":"opendir","expanded":true,"children":[{"id":"e31d291f-f823-4878-9844-cc8e5945ac79","topic":"把目录的所有FCB读入到内存中","expanded":true}]},{"id":"83eca921-0090-4d63-aa25-f1c1c827bcf2","topic":"readdir","expanded":true,"children":[{"id":"e44a3e3c-ee58-4ece-a117-742bd17a3b11","topic":"从opendir中的FCB中找文件的对应fd","expanded":true}]},{"id":"9af7f076-32b4-4aec-93ec-d2c54b35b025","topic":"rename","expanded":true,"children":[{"id":"dab74a45-3e51-492a-ace2-042a5d0fc38c","topic":"本质是修改指向这个目录文件的FCB中的名字","expanded":true}]},{"id":"72d2daba-e769-46f5-963a-c5e585163711","topic":"link","expanded":true,"children":[{"id":"fe9cb737-be73-461a-af93-4f8404acc6d8","topic":"硬链接","expanded":true}]},{"id":"67aab475-ee93-4b47-a631-e5cba0e22852","topic":"unlink","expanded":true,"children":[{"id":"309e5e6e-9075-4bda-b483-b51300e7e774","topic":"解除硬链接","expanded":true}]}]}]},{"id":"5ce666c6-884a-4937-8aad-9f7b09179397","topic":"目录的物理实现：","expanded":true,"children":[{"id":"4936fd4f-788e-4b8e-99d5-12b8db4a84b0","topic":"线性列表","expanded":true,"children":[{"id":"1f693125-94b7-44c7-90b5-cc38bd995e3f","topic":"对应线性查找","expanded":true}]},{"id":"a568fc04-3508-49e8-ba75-fc94c0bc51dd","topic":"哈希表","expanded":true,"children":[{"id":"3d5de4b6-a6ea-4296-b9b9-ea7c9056fbb5","topic":"采用哈希函数来快速定位文件","expanded":true}]}]},{"id":"b2b973eb22996f42fe6788fc61","topic":"共享","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"0c1867481fd82e1daf23482af2","topic":"硬链接","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"eeab40fae958b5da67e1cad6c3","topic":"文件指向同一个inode","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-5b7e90bdeddb0f.png","width":472.72,"height":255.61},"children":[{"id":"98e82717-3ba7-4dee-a502-b61f615faea4","topic":"索引节点的两大功能","expanded":true,"children":[{"id":"be2b69d0a93ab928db8f597ddb","topic":"文件链接数","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"0f89ede592f8a00fe7ceb9d364","topic":"在采用索引节点存储方式的OS中，文件目录可以指向同一个索引节点，文件链接数就保存这个值","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"e85b458dff39de929754fbd2fd","topic":"链接数!=0，不能删除文件","expanded":true}]},{"id":"067b4ed7fb58410475d31bc967","topic":"访问计数","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a31a23fead884756c8667b678d","topic":"在内存中运行时的访问计数","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]}]},{"id":"5e5ab36d7ea85dd76417ea88cf","topic":"软链接","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"e69ec81c-691c-46e4-8e3f-acf76e1939d9","topic":"使用符号链，创建一个LINK类新文件","expanded":true,"style":{"background":"#8EDDF9"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-c6fc8d9eea3521.png","width":470.56,"height":256.92},"children":[{"id":"bd2a76a94e6a1ddc237658f689","topic":"新文件：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"9f1a718b2108018df0b6991d40","topic":"创建一个LINK类型的新文件","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"e12bf991cba879dc8cd4b8225b","topic":"LINK中只存储符号链","expanded":true}]},{"id":"95cb25f0897b9dca123f295245","topic":"软链接特点：","expanded":true,"children":[{"id":"838814afd879c8155400cae381","topic":"软链接文件只存储路径","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"10f94bd666591b7d89a9698035","topic":"不知道文件是否被删除","expanded":true,"children":[{"id":"0a19c4c2a8fb470f0eb12bcb6d","topic":"一访问就知道","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]}]}]},{"id":"1c3d11a1-9a5c-40f1-800b-279dca74c0e1","topic":"文件的目录结构是文件的目录的结构信息，例如：单极、多级目录","expanded":true,"style":{"background":"#EEEEEE","shape":"rounded"}},{"id":"856b1b2e-3389-4044-b4b1-015f862bd112","topic":"考频：中","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"810b0361-febf-46da-9961-5f02a68b52fb","topic":"09、10、17、20、21","expanded":true}]}]},{"id":"48f81ec8b129956e67a049ab7f","topic":"文件系统","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-10b98166f49f62.svg"},"children":[{"id":"bafbb40a-ac67-49d0-abcb-139c7b2be2ba","topic":"考频：低","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"714c4a0f-0f48-42db-bb8c-597b43829ef7","topic":"15、19","expanded":true}]},{"id":"79ff80dd-6908-437b-a7fb-d1f5870019a1","topic":"OS管理外存的空闲盘块、分区、VFS等","expanded":true,"style":{"background":"#EEEEEE","shape":"rounded"}},{"id":"61a5f04e-e9fc-4308-9d09-ec125b0f528d","topic":"文件系统结构：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"40c0ce6d-6f1c-45d5-9f76-7689609f545d","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-d403586e813ea1.png","width":182.73,"height":430.96},"children":[{"id":"75fd71f9-5a85-4721-8c2f-07f0fff3e3c0","topic":"4. 逻辑文件系统","expanded":true,"children":[{"id":"daced21e-b3fe-4b2d-b48b-3f367799f86f","topic":"管理元数据信息","expanded":true,"style":{"background":"#FF9595"}},{"id":"68ba4f0c-0686-4978-ad12-831f8a9b9900","topic":"包括文件所有结构，不包括实际数据（文件内容）","expanded":true},{"id":"bc627ed2-68bc-4cbb-8553-be94c0e037cd","topic":"管理目录结构，通过文件控制块维护文件结构、文件保护","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"9812002c-e2d4-4ace-805f-c0065c42cbfe","topic":"3. 文件组织模块","expanded":true,"children":[{"id":"33201b38-ae12-4bce-9038-1540e398183b","topic":"组织文件、文件的逻辑块和物理块","expanded":true},{"id":"aae24214-3829-4108-8e8d-cef71a6b8e16","topic":"可以把逻辑地址转为物理地址","expanded":true,"style":{"background":"#FF9595"}},{"id":"f851e0bb-5eb8-4aa4-9654-a9ba951726f1","topic":"包括空闲空间管理器，跟踪没有被分配的块","expanded":true}]},{"id":"bbf222f5-c348-4ae3-a232-beae4a8de22f","topic":"2. 基本文件系统","expanded":true,"children":[{"id":"9bbe110c-5308-426f-9953-6208c2b5aed7","topic":"向对应的设备驱动程序发送通用命令，以读取和写入磁盘的物理块。","expanded":true,"style":{"background":"#FF9595"}},{"id":"9f71289e-1039-4edb-9bf6-fa09cec012fc","topic":"管理内存缓冲区，保存各种文件系统、目录、数据块缓存。","expanded":true}]},{"id":"67b39af8-cc0c-453c-a9ac-21ed84c8ebfa","topic":"1. I/O控制","expanded":true,"children":[{"id":"230a54d9-13e4-48b1-867f-f57c8d8518dd","topic":"包括设备驱动程序和中断处理程序，在内存和磁盘系统之间传输信息","expanded":true},{"id":"fad1dc10-8876-4e25-9514-535934a09f41","topic":"将输入命令翻译成硬件指令","expanded":true,"style":{"background":"#FF9595"}}]}]}]},{"id":"8639d75c20ca061dd161498d0a","topic":"划分和初始化","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"4d4a0293a8aa2be2a9dbca9e1b","topic":"划分：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"06d8585e032b3b7203755b6da8","topic":"超大型文件卷可以有多个物理盘","expanded":true,"style":{"background":"#8EDE99"}},{"id":"68e85063ead970e53869193465","topic":"一个物理盘可以分为多个卷","expanded":true,"style":{"background":"#8EDE99"}},{"id":"e9ea0693390abf29f8fc29823c","topic":"每个卷可以分为目录区+文件区","expanded":true,"children":[{"id":"9fcaa651be8b0d69b0792bf2e2","topic":"目录区：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"644a972bda1993733c86786c59","topic":"存放FCB（文件控制块）","expanded":true,"style":{"background":"#8EDE99"}},{"id":"468807509fca0ac7da46e8e3fb","topic":"磁盘存储空间管理的信息","expanded":true,"style":{"background":"#8EDE99"}}]},{"id":"f5751945-e195-4720-b6c2-da76a25cbc0b","topic":"文件区：","expanded":true,"children":[{"id":"722db0c9-0ad8-487d-a42c-e274be15beab","topic":"存储文件数据","expanded":true}]}]}]}]},{"id":"95faec7ec6a9cf288a50d933cf","topic":"外存空闲空间管理","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"331b78e9594a7b0843a8688d91","topic":"空闲表法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c2aa08e3264a20660ff5397367","topic":"分配方式：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"3e79f8fa6f7a767037bb5b6715","topic":"连续分配","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"70650e2a-e78c-49d3-a928-c71642528f67","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-5b4e45826cea4b.png","width":427.43,"height":300.15}}]}]},{"id":"11882f4c352bfbc00699c8b521","topic":"空闲盘块表：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"aaba83fea12a894df0a50beb31","topic":"<空闲盘块号、空闲盘块数>","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"6069104764b92b9915c139633e","topic":"分配算法：","expanded":true,"children":[{"id":"b8ab8fe20058583df229fb939b","topic":"最佳、首次、最坏、临近","expanded":true}]},{"id":"94f93926462b5d7c991f5b6e93","topic":"存储回收：","expanded":true,"children":[{"id":"f9c94e5fc43a8eb459c5696c62","topic":"和动态分区分配内存回收算法一致","expanded":true}]}]},{"id":"c7281863eb99fd97abcc984eaa","topic":"空闲链表法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a5ec21e9-1818-4494-ae76-aadd3d81f9c6","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-68c89344333ad8.png","width":549.1,"height":352.97}},{"id":"0afab93b41a9f7b6d22b5a3525","topic":"空闲盘块链：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"01e9245b8d19c38c6d12190209","topic":"分配模式：","expanded":true,"children":[{"id":"e1d92efd0828a9691f1f4bc789","topic":"离散分配","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"95aa07d1524aa85fafda98afba","topic":"数据结构：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"2a08a3c79f0835bfc3533ac716","topic":"每一个盘块都有指针、一个链头、一个链尾","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"8cb91025fc7b9bf7e514b807bd","topic":"分配算法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"8379e0029b8b21a41eadd8b290","topic":"从链头拿k个块，分配给进程","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"edcb5d18ac4b2125387dc93e73","topic":"回收算法：","expanded":true,"children":[{"id":"ddf9f94fbe985dc8a1354af2df","topic":"把回收的盘块，放到链尾","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"7979a15a41dae38a8287e89cdd","topic":"空闲盘区链：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6148e7a3108b51dc6ee7299783","topic":"分配模式：","expanded":true,"children":[{"id":"4d7a04b713a9833c22f14b0888","topic":"离散分配+连续分配","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"802ae3dd0c5b3f2cb2f4aa6ceb","topic":"数据结构：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"7979b81095b85332d3098a1ff6","topic":"每一个盘区由相邻的盘块组成，每个盘区有一个链头、一个链尾、本盘区大小","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"448937e3e46b052293de1990a0","topic":"分配算法：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c63a64b580894eb7d37b2be86d","topic":"和内存的动态分区分配一样，通常采用首次适应算法","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"32ea9ec15a78bdd0802ecb5c25","topic":"回收算法：","expanded":true,"children":[{"id":"37085d0c342a01f5c8f189731d","topic":"将回收区和相邻的空闲盘区合并","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]},{"id":"581811d257b9c918458d890c91","topic":"位示图法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"7b7a413ea49b0420fd4259ec0b","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-5443b20439e4df.png","width":475.21,"height":149.73},"children":[{"id":"b13ab2f762287aa130a0c9a78b","topic":"字号、位号和盘块号进行转化","expanded":true}]},{"id":"df89f55b5eabfe30f4e06b7a03","topic":"分配算法：","expanded":true,"children":[{"id":"08272592-88b3-4cba-bbe2-5ea78e62b212","topic":"如何分配：","expanded":true,"children":[{"id":"0200f983-a7d0-45ae-99f2-169d49ee13b8","topic":"需要M个，就顺序扫描位示图，找到M个0就行（无所谓连续与否）","expanded":true}]},{"id":"fe0b150639aac224df83a980dd","topic":"如何找k个连续的","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f45928c4f59b4426d42eb87f81","topic":"在二进制数组中找到k个相邻的空闲块（k个连续0）","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"129873c6e22b6874ca970b391d","topic":"然后把这个k个二进制位改为1","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"3d99f23beed86be2548ec90d46","topic":"回收算法：","expanded":true,"children":[{"id":"48db75bad81acef4e38648867d","topic":"首先获得盘块号，然后推出位示图的行号和列号","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"e2ab5266c84ac166e1eb58c090","topic":"修改位示图，把对应的二进制位改为0","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"e659fcbd5658183afc00e9329a","topic":"成组链接法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"f5fb3cccdf0b5ab15d3cbb9efe","topic":"上述算法的缺点：","expanded":true,"style":{"background":"#FF9595"},"children":[{"id":"a758fbd16d0b6ebef53709637c","topic":"无法适用于大型文件系统，因为会导致空闲表和空闲链表太大","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"624dbc68-b190-45c9-9eac-f032fbca2c00","topic":"超级块","expanded":true,"children":[{"id":"4ca81311-188d-4949-a5e6-9b4feddcb2d9","topic":"成组链接法的第一块","expanded":true}]},{"id":"07bbb0e2d408b51d32db9b52a9","topic":"图示：","expanded":true,"children":[{"id":"ee047864-fb3a-4149-a32f-860a7e9538d2","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-eb6a4df2d8155e.png","width":560.52,"height":327.86},"children":[{"id":"42566cf7-440a-46fb-b9af-0eb6c7eaa7f1","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-7e5ebec55d76dd.png","width":665.27,"height":332.89}}]}]},{"id":"bb5ad06c47b8b01e3d33991ee8","topic":"分配算法：","expanded":true,"children":[{"id":"e69a1ce8e7fb7e057033895ea8","topic":"需要小于当前空闲块号：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4f4b01f080f8099fd46d0b4a6f","topic":"分配块出去，修改超级块的 1. 空闲块数 2. 空闲块号信息","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"804aead8c87a774fc9341b85a4","topic":"需要超过当前空闲块号：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"b7e8d30dc398bd618faa9b3e76","topic":"把下一个分组的块号表复制到这个超级快中，分配出去当前所有的空闲块号，如果还不够继续复制+分配","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"3d2ad6803178aba0b218492dc4","topic":"回收算法：","expanded":true,"children":[{"id":"db78ed05e96a682e2cab08caa9","topic":"如果有位置就填入到超级块当中","expanded":true,"style":{"background":"#8EDDF9"}},{"id":"5d8a20bf592b08156dd00a81db","topic":"如果位置满了，就新建一个“成组链块”，指向现在满的这个超级块","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]},{"id":"54c9fdda-fa57-4abd-b490-b9d062ed8eef","topic":"虚拟文件系统","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"89078820-08da-4232-8ba9-6c096ad08809","topic":"虚拟文件系统采用了面向对象的思想，它抽象出一个通用的文件系统模型，定义了通用文件系统都支持的接口。新的文件系统只要支持并实现这些接口，即可安装和使用。","expanded":true,"style":{"background":"#8EDE99"}},{"id":"d8b118f3-0beb-4b5f-a214-9da13185dad0","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-04ca717b39cffc.png","width":418.89,"height":465.95},"children":[{"id":"dc67be4d-2571-4a02-99ba-8c8ea3a09305","topic":"① 向上给进程提供一个统一的read、open调用","expanded":true},{"id":"93fd0103-b519-4be5-92b0-b1117b49edca","topic":"② 向下规定所有文件系统提供统一的打开、读、写、格式化等操作","expanded":true},{"id":"e7d35491-adca-4fcf-8309-07c40e013d31","topic":"③ VFS维护自己的在内存中的vnode，来表示文件，无论文件存储在哪一个文件系统中","expanded":true},{"id":"a4ff8c69-8258-49c5-82c0-90f3a814bb33","topic":"write()","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"c147c9af-a5fa-4402-9782-278f3cd46da1","topic":"sys_write()","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"4e8c58f0-3903-4635-8c79-e83c3dec3492","topic":"文件系统的写方法","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"794bc9d6-c68d-49d2-8e25-0fcd18506572","topic":"物理介质","expanded":true,"style":{"background":"#8EDDF9"}}]}]}]}]},{"id":"898bcf32-78ec-4062-9b43-1cc718863b28","topic":"Linux抽象的四种对象类型","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"cee2a717-57a3-4ddb-8f9a-6414dbd3c540","topic":"图示","expanded":true,"style":{"background":"#8EDE99"},"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-307d54fb24c872.png","width":350.64,"height":212.38},"children":[{"id":"aca7e9b0-cf71-4ee4-8dfe-213d7a054cf9","topic":"超级块对象","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e53b8711-30b7-490c-b6fe-80a8914cfb08","topic":"表示一个已安装（挂载）的特定文件系统","expanded":true,"style":{"background":"#FDD834"}},{"id":"5d9d0441-8b87-44af-bded-987ba17e02cf","topic":"对应磁盘中扇区的文件系统超级块，存储已安装文件系统的元信息","expanded":true,"style":{"background":"#FF9595"}},{"id":"6d9c034b-4ce0-435f-bb75-c478ccd0b407","topic":"有对超级块进行更改的操作函数，例如分配、销毁、读写inode等","expanded":true}]},{"id":"5c91c8d2-c0c9-4293-9eca-5ae3c127e38b","topic":"索引结点对象","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"7d848688-bb9e-42cc-a4b3-567539c305a5","topic":"表示一个特定的文件","expanded":true,"style":{"background":"#FDD834"}},{"id":"bb5d98be-a88c-447a-bdc0-14cfc5455dbf","topic":"文件系统处理文件所需要的所有信息，都放在里面，索引结点对文件是唯一的","expanded":true,"style":{"background":"#FF9595"}},{"id":"e88d3d4b-6a8b-41d9-8e7a-a731a07b540a","topic":"操作例如创建索引节点、硬链接、新目录等","expanded":true}]},{"id":"0dcfbe19-a459-4e77-92ac-88aec1d754eb","topic":"目录项对象","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"9d6ad5dd-5de3-4d11-9d90-ef8c205053d7","topic":"表示一个特定的进程","expanded":true,"style":{"background":"#FDD834"}},{"id":"25fbad3b-f142-42d6-b1d0-b71f65946a16","topic":"由于VFS经常执行切换到某个目录这种操作，为了提高效率，便引入了目录项的概念","expanded":true,"style":{"background":"#FF9595"}}]},{"id":"337e6e27-f848-4f7a-a7da-7dadd5e530cc","topic":"文件对象","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"e9841388-fb77-4dc1-bad1-30bd57379b64","topic":"表示一个与进程相关的已打开文件","expanded":true,"style":{"background":"#FDD834"}},{"id":"f07e2214-0ef6-4656-8689-ac473db2f0ad","topic":"文件对象代表进程打开的一个文件，open()调用打开，close()调用关闭","expanded":true,"style":{"background":"#FF9595"}}]}]}]}]},{"id":"325756c4-bc9f-4d52-bba7-9053c704f11a","topic":"分区、安装","expanded":true,"children":[{"id":"dc981c59-70bf-45be-b804-620b59d3d84c","topic":"分区：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"a9a8006b-d46f-4f99-a347-566a140b8697","topic":"一个磁盘可以划分为多个分区，每个分区可以创建单独的文件系统，也可以有不同的操作系统","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"fc55afc9-d44e-4d94-9f2b-04e917fc4a4c","topic":"（例：装双系统）","expanded":true,"style":{"background":"#FDD834"}}]},{"id":"facb3b7b-85e5-4330-b827-4ba7494b037b","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-9ac1315b9fbf39.png","width":442.29,"height":80.12}},{"id":"95586846-74df-41f7-b5ae-bb97ee0ba98e","topic":"引导块：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6dbe11db-25fe-4034-8c88-0a33270f2196","topic":"存储引导信息，存储一系列连续的代码，可以启动一个具体操作系统的引导程序。","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"8ec2c8c5-6ef9-48a8-b39a-ed4418f5cc23","topic":"超级块：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"75691e51-a4d5-4476-b2e2-9c9bafd44a24","topic":"存储和文件系统有关信息，例如文件系统类型、i结点的个数、数据块个数等。","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"7f06bc10-9e42-4c27-967a-ff275baf26b6","topic":"i 结点：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"cd241f9d-792e-45c6-91ad-a28e8268ca5b","topic":"inode，有多个，每个文件对应一个","expanded":true,"style":{"background":"#8EDDF9"}}]},{"id":"14167537-55e3-4f73-960c-433e80f3674d","topic":"数据块：","expanded":true,"style":{"background":"#8EDDF9"},"children":[{"id":"6afc29e1-3f34-4f72-945c-a2758246b77d","topic":"存文件数据","expanded":true,"style":{"background":"#8EDDF9"}}]}]},{"id":"4dfd9d26-6d8e-4c6c-b857-7d1949e1651f","topic":"安装：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"613af96e-e156-4279-8684-ed6fbdff8028","topic":"安装 ↔ 挂载","expanded":true,"style":{"background":"#FDD834"},"children":[{"id":"262ce5bf-dc3a-404a-a1c0-60f103965bfa","topic":"例如：插入U盘","expanded":true}]},{"id":"8d26a9bf-7e12-4247-a293-00c032f88917","topic":"WINDOWS/MAC自动发现设备，安装找到的文件系统","expanded":true,"style":{"background":"#8EDE99"}},{"id":"b6eb5a29-954c-43b8-a3b0-5c2e60281524","topic":"UNIX需要自行挂载文件系统：","expanded":true,"style":{"background":"#8EDE99"},"children":[{"id":"657b6475-fb36-42d1-852a-13e5f53b2ee0","topic":"mount -t ex2 /dev/fd0 /flp","expanded":true,"children":[{"id":"e3a9695b-969f-45c7-b148-eed2afe5ba3f","topic":"umount进行解除","expanded":true}]}]}]}]}]},{"id":"49812553-7ff1-4cd8-b5eb-3380e4a52cf4","topic":"两个补充","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-fb96c55c1fee10.svg"},"children":[{"id":"6022c600-8407-488a-ac36-b51fee04e646","topic":"UNIX文件系统","expanded":true,"children":[{"id":"59d6c6ef-1cbe-4960-b21c-21bd08fccd79","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-97b84e6cc7d2ed.png","width":1304.4,"height":485.06}}]},{"id":"d6e52b67-3033-48d5-a125-6173e73c3d27","topic":"全局结构Layout/\n文件在内存中的结构","expanded":true,"children":[{"id":"421a1c58-cbef-4d16-8fa0-ca6fe959d43f","topic":"概念：","expanded":true,"children":[{"id":"20dcf5a6-f5d6-429f-b04e-ea14c6ca2b9c","topic":"目录缓存：","expanded":true,"children":[{"id":"205db7db-e98a-4b40-bf8b-27b3524ba801","topic":"把最近读入过的目录文件的数据保存在内存中","expanded":true}]},{"id":"3f62917c-a250-4df2-87d8-f7fb3c9818a5","topic":"系统打开文件表：","expanded":true,"children":[{"id":"49356761-0072-4474-9a82-66c08528cc0f","topic":"保存一个系统中现在打开的文件，已经打开过多少次","expanded":true}]},{"id":"43b87b42-f910-4344-a8d9-37b5cf5eecd4","topic":"进程打开文件表：","expanded":true,"children":[{"id":"61090b7d-de69-43a3-b3ae-a4add909dddd","topic":"保存一个进程打开了哪些文件，记录在进程的PCB中","expanded":true}]}]},{"id":"94633749-93af-480d-8240-b2b0fc72a059","topic":"图示：","expanded":true,"children":[{"id":"0cb64898-44a4-4bd7-94ea-c0c3203f3967","topic":"图示","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-1bdbdddc6b2206.png","width":662.24,"height":366.11},"children":[{"id":"ff22b34b-1340-497f-82bb-55ad5145b436","topic":"① 使用open调用把文件目录调入内存","expanded":true},{"id":"4a7e8c08-7329-4611-8c2b-b6c19478d3c2","topic":"② 根据open中的文件名参数，在内存的目录缓存中找到对应的文件，记录其FCB等信息","expanded":true},{"id":"cbcb2654-f283-4e5b-9039-118706fefc58","topic":"③ 打开这个文件的进程同样需要把这个文件信息写入到自己的打开文件表中","expanded":true},{"id":"4b8c7365-422e-4b1d-96c4-1e61d6364ba8","topic":"如果用户要读一个文件","expanded":true,"children":[{"id":"7c727e8b-39f2-4eb2-853c-c9922bad6ea7","topic":"用户使用read(fd, xx, xx)来 1. 找进程打开文件表 2. 系统打开文件表 3. 访问外存","expanded":true}]}]}]}]}]},{"id":"838bd891-7575-47af-a0e5-ba50fd952959","topic":"END","expanded":true,"image":{"src":"https://gastigado.cnies.org/d/BrushUP/mm-e9c38dbbd7742f.svg"}}]},"relations":[{"id":"31b6ed12-dacd-44a5-8594-1cd6de32e397","from":"d8686039872b05bd29adab0024","to":"b7f9fa700cb86831eb33882eef","bidirectional":false}],"summaries":[{"id":"ab391aa1-1857-420a-a0f9-2e4b804254ae","parentId":"94e8d509e089866da21f9b1a2c","start":0,"end":1,"label":"因为索引表中含有表长，所以支持随机存储"},{"id":"39d28891-83bf-4ce6-a242-659526b9b4c3","parentId":"6f988cc392e89b2ecb0fd928c5","start":0,"end":1,"label":"搜索速度都很快，但是太浪费空间，一般不用"},{"id":"c61733f3-8ca3-44cc-a899-fb322eda0e88","parentId":"c10986a5d17bf1285ec80ab0fd","start":0,"end":1,"label":"故访问一次FCB需要访问两次内存"},{"id":"9a7d559e-9428-4f49-af25-079b2212c1a5","parentId":"8a48cc5be72adf989cafea2c00","start":0,"end":0,"label":"inode"},{"id":"1c42c330-d0a5-4ee0-b49f-c10513ff63d7","parentId":"733dd873-6783-4351-83d1-771683266baf","start":0,"end":3,"label":"用于管理文件的重要内容"},{"id":"4cd75cd7-fd76-495c-9c7c-6976d6264814","parentId":"be69feec48f976731e7f792920","start":1,"end":1,"label":"当前工作目录"},{"id":"4aac23af-66ea-41db-b582-f6de0e5ef9a2","parentId":"bafbb40a-ac67-49d0-abcb-139c7b2be2ba","start":0,"end":0,"label":"新考点"},{"id":"c41f7c93-7717-4b96-ae79-3262b491ae94","parentId":"4d4a0293a8aa2be2a9dbca9e1b","start":0,"end":1,"label":"就是Windows系统的CDE盘"},{"id":"c54344bd-0715-4e8b-a85e-0ac258fab4ac","parentId":"331b78e9594a7b0843a8688d91","start":2,"end":3,"label":"动态分区分配在内存管理的【连续分配】是高效的办法，比较低效是固定大小分区、直接分配"},{"id":"e1e27121-56a3-418e-b94c-46739329d909","parentId":"d8b118f3-0beb-4b5f-a214-9da13185dad0","start":0,"end":2,"label":""},{"id":"1820d2f0-f284-4bfe-928f-4c6d1b710f27","parentId":"48f81ec8b129956e67a049ab7f","start":2,"end":2,"label":"之前的图"},{"id":"2a5df80c-0e5d-49cd-88e8-9b5d9c5d2b1d","parentId":"0cb64898-44a4-4bd7-94ea-c0c3203f3967","start":1,"end":2,"label":"区别：【系统的打开文件表】记录的是文件在外存中的【地址】；而【进程的打开文件表】记录的是系统打开文件表的【索引号】"}],"boundaries":[{"id":"11ac6b5c-ef2d-45c8-9e50-e059d6c43c65","parentId":"53486bce-8600-486e-a753-c7ab415a2a4a","start":0,"end":1,"label":"物理结构"},{"id":"25cf60df-66d7-407a-b71c-41bbb9b346b0","parentId":"98e82717-3ba7-4dee-a502-b61f615faea4","start":1,"end":1,"label":"索引节点中"},{"id":"6b6c3ae2-834b-4941-9829-506da853a3fa","parentId":"98e82717-3ba7-4dee-a502-b61f615faea4","start":0,"end":0,"label":"磁盘索引节点中"},{"id":"2b6283e9-88bc-42d8-9783-ecacc5d4a69e","parentId":"d8b118f3-0beb-4b5f-a214-9da13185dad0","start":3,"end":3,"label":"Linux中调用write()的例子："}]}