123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- <!DOCTYPE html>
- <html lang="en-US">
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width,initial-scale=1">
- <title>文件系统 | 操作系统实验</title>
- <meta name="generator" content="VuePress 1.9.10">
-
- <meta name="description" content="Welcome!">
-
- <link rel="preload" href="/OS_lab_tutorial/assets/css/0.styles.dbcc0abd.css" as="style"><link rel="preload" href="/OS_lab_tutorial/assets/js/app.de832b6b.js" as="script"><link rel="preload" href="/OS_lab_tutorial/assets/js/2.6cca19a7.js" as="script"><link rel="preload" href="/OS_lab_tutorial/assets/js/1.2e5d3cee.js" as="script"><link rel="preload" href="/OS_lab_tutorial/assets/js/21.160e1109.js" as="script"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/10.e3ae3b6e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/11.c389195a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/12.15e02b09.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/13.e100960d.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/14.3675c8e8.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/15.5542c093.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/16.01c35b5f.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/17.bd8d538c.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/18.6d3b94c1.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/19.eb35cfee.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/20.c11ec329.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/22.8c6c68bf.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/23.6c245a02.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/24.c2cc382b.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/25.3a441277.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/26.7dca1b95.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/27.9fdfa008.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/28.ea152bf8.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/29.310b119e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/3.5322f14a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/30.1be87618.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/31.e60e769a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/32.ed12ff5e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/33.d0e6ffd8.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/34.fb25dd7d.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/35.38b1a166.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/36.f2dcdc62.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/37.85edb076.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/38.a07efacb.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/39.2e2bced7.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/4.ba0ffc9e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/40.7564ba2d.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/41.7bc98649.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/42.ee9b7b13.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/43.dbdee45b.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/44.f24405f8.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/45.bebd92ee.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/46.5d70de3f.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/47.0df811bd.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/48.3f21f3a0.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/49.4ceb6d85.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/5.1674539b.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/50.9d21087d.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/51.760bed26.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/52.78b43a02.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/53.fd428cc4.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/54.4937721a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/55.b040b54f.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/56.f538318b.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/57.47c5385e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/58.c8103992.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/59.7a4c397a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/6.44f67c6a.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/60.1f64a100.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/61.8ebdd979.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/62.6cab9dfb.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/63.380a795e.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/64.57bfd1e1.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/65.54ffadf5.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/66.dccb9c04.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/7.21830bc0.js"><link rel="prefetch" href="/OS_lab_tutorial/assets/js/vendors~docsearch.cf079a49.js">
- <link rel="stylesheet" href="/OS_lab_tutorial/assets/css/0.styles.dbcc0abd.css">
- </head>
- <body>
- <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/OS_lab_tutorial/" class="home-link router-link-active"><!----> <span class="site-name">操作系统实验</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/OS_lab_tutorial/" class="nav-link">
- 首页
- </a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Linux" class="dropdown-title"><span class="title">Linux</span> <span class="arrow down"></span></button> <button type="button" aria-label="Linux" class="mobile-dropdown-title"><span class="title">Linux</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
- 实验教程
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab3/" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab4/" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li><li class="dropdown-item"><h4>
- 课程练习
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab3.html" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab4.html" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li><li class="dropdown-item"><h4>
- 附录
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab3.html" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab4.html" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="DragonOS" class="dropdown-title"><span class="title">DragonOS</span> <span class="arrow down"></span></button> <button type="button" aria-label="DragonOS" class="mobile-dropdown-title"><span class="title">DragonOS</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
- 实验教程
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
- 实验-文件系统
- </a></li></ul></li><li class="dropdown-item"><h4>
- 课程练习
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Assignment/Lab1.html" class="nav-link">
- 实验-文件系统
- </a></li></ul></li><li class="dropdown-item"><h4>
- 附录
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Appendix/Lab1.html" class="nav-link">
- 实验-文件系统
- </a></li></ul></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/OS_lab_tutorial/" class="nav-link">
- 首页
- </a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="Linux" class="dropdown-title"><span class="title">Linux</span> <span class="arrow down"></span></button> <button type="button" aria-label="Linux" class="mobile-dropdown-title"><span class="title">Linux</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
- 实验教程
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab3/" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab4/" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Lab/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li><li class="dropdown-item"><h4>
- 课程练习
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab3.html" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab4.html" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Assignment/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li><li class="dropdown-item"><h4>
- 附录
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab1.html" class="nav-link">
- 实验1-熟悉类Linux系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab2.html" class="nav-link">
- 实验2-进程创建与进程间通信
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab3.html" class="nav-link">
- 实验3-进程调度算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab4.html" class="nav-link">
- 实验4-存储管理算法
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab5.html" class="nav-link">
- 实验5-文件管理系统
- </a></li><li class="dropdown-subitem"><a href="/OS_lab_tutorial/Linux/Appendix/Lab6.html" class="nav-link">
- 实验6-网络编程(暂定)
- </a></li></ul></li></ul></div></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="DragonOS" class="dropdown-title"><span class="title">DragonOS</span> <span class="arrow down"></span></button> <button type="button" aria-label="DragonOS" class="mobile-dropdown-title"><span class="title">DragonOS</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><h4>
- 实验教程
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html" aria-current="page" class="nav-link router-link-exact-active router-link-active">
- 实验-文件系统
- </a></li></ul></li><li class="dropdown-item"><h4>
- 课程练习
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Assignment/Lab1.html" class="nav-link">
- 实验-文件系统
- </a></li></ul></li><li class="dropdown-item"><h4>
- 附录
- </h4> <ul class="dropdown-subitem-wrapper"><li class="dropdown-subitem"><a href="/OS_lab_tutorial/DragonOS/Appendix/Lab1.html" class="nav-link">
- 实验-文件系统
- </a></li></ul></li></ul></div></div> <!----></nav> <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>文件系统</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#本章导读" class="sidebar-link">本章导读</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#dragonos文件系统的架构设计" class="sidebar-link">DragonOS文件系统的架构设计</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#虚拟文件系统" class="sidebar-link">虚拟文件系统</a><ul class="sidebar-sub-headers"></ul></li><li><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#vfs的架构设计" class="sidebar-link">VFS的架构设计</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#file" class="sidebar-link">File</a></li><li class="sidebar-sub-header"><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#traits" class="sidebar-link">Traits</a></li><li class="sidebar-sub-header"><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#mountfs" class="sidebar-link">MountFS</a></li></ul></li><li><a href="/OS_lab_tutorial/DragonOS/Lab/Lab1.html#ramfs" class="sidebar-link">RamFS</a><ul class="sidebar-sub-headers"></ul></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="文件系统"><a href="#文件系统" class="header-anchor">#</a> 文件系统</h1> <h2 id="本章导读"><a href="#本章导读" class="header-anchor">#</a> 本章导读</h2> <p>本章意在介绍文件系统相关知识,包括虚拟文件系统、ramfs。</p> <h2 id="dragonos文件系统的架构设计"><a href="#dragonos文件系统的架构设计" class="header-anchor">#</a> DragonOS文件系统的架构设计</h2> <p>首先,我们来总览一下DragonOS文件系统的架构设计。相关的机制主要包括以下几个部分:</p> <blockquote><ul><li><p>系统调用接口</p></li> <li><p>虚拟文件系统</p></li></ul> <blockquote><p>文件抽象(File)</p> <p>挂载文件系统(MountFS)</p></blockquote> <ul><li>具体的文件系统</li></ul></blockquote> <p>如图所示:</p> <p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHZCAYAAAAc4ptnAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACL2SURB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f8AlZkwbiEyk5jVqWUHbjh1EurdsSDRjMao4n5Yyx551CqkeGokUu1ftpOZbFRQHarnfXP93tHPTvG+JmPp44CsqqGohe9+7xd1McY9x43q93BrJo73Kn2CdPOWqkK6zuuahSQ5Xhm785X5IJx6ZTKZn4HXjaM6fEFLqDqWe9OKpNxVdhbdCLOo1a0yolO5aSnVOWcV6mOmLf6r0Y6vlu9Gz/3YlCPhDSqzsrVOhLDGCxJk4+G+qvOcV53m406DQ+rzsF1tsO78WGHu04wLpsyjDqtcMbKEFSkHQxnmx/ym1U37e1y/GtyX3WbG4pbjVZrGLu75aSnc8TiiY9qbL1tRPe+nyV5UVUF0m1OhgPXY7eqxPfqN6OcYZ3v+/Sw6MmPN+3GsKpgv4ATKK9BO7a7s5PIZsdaq3Y4al6xYjzxUY1nvWjMDdveTa6ucZPK2V0/RTy3Q7u4S7Vd2bm9iPjx7m94d1H5xpCjtQsOY5YAP1r7Ik7B/zwut05e6r1g5DraTsUIAIlgBIDEUCoAJCpGAEgEIwAkghEAEsF4k8pHDnx58eVcqu3qL5xequ+5vD6XusBr+bjG0n2X60Vcbp28jovtLqvraDvBCACJYASARDACQCIYASARjACQCEYASAQjACSCEQASwQgAiWAEgEQwAkAiGAEgcaFiAEhUjACQCEYASATjTXI9xstzPcZb53qMN8H1GG+b6zECwDUTjACQCEYASAQjACQ+x3iTygkkz3oxqCdj5UHE+3/qiawZ//l2EP/9rZ6csxIP4n2c9qiHKxEf3tcTc76Jr+OP+LOemrNwGR5Wr/SheqVTfPtdNH/7dfZ3JDe6DI1O7L3eiNV68tPKiQ5b0RvWk/elHbIbXoZW9yC22/XEeZSTb3b79cRZy7B4Pf7q31/F37//XU9l190On2sZmtF5+So2HtWT51BOIJk1631ph+yal+Gq6/EJghEAEkOpAJAIRgBIBCMAJIIRABLBCACJYASARDACQCIYASARjAAwFfH/AVuCjI5UvnDMAAAAAElFTkSuQmCC" alt="图片1" title="文件系统架构设计"></p> <p>其中我们可以看到,中间部分作为接口对多个并行的物理文件系统实例(每一个都叫做文件系统的实现)提供支持。这就是虚拟文件系统。</p> <h2 id="虚拟文件系统"><a href="#虚拟文件系统" class="header-anchor">#</a> 虚拟文件系统</h2> <p><code>虚拟文件系统</code>(Virtual File System,缩写为<code>VFS</code>)是计算机操作系统中的一个抽象层,它提供了文件系统的标准化接口,使得应用程序可以通过统一的方式访问各种不同类型的文件系统。</p> <p>其设计目的是将文件系统的实现细节与应用程序分离,使得应用程序可以独立于底层文件系统的具体实现方式。它定义了一组通用的文件操作接口,如打开文件、关闭文件、读取文件、写入文件等,应用程序可以通过这些接口来访问和操作文件,而无需关心文件系统的底层细节。例如,一个应用程序可以通过虚拟文件系统接口打开一个文件,而不需要关心这个文件是存储在本地磁盘上的普通文件,还是位于远程服务器上的网络文件。虚拟文件系统会将这些不同类型的文件系统映射到一个统一的文件层次结构中,使得应用程序可以以相同的方式访问这些文件。</p> <p>在<em>DragonOS</em>中,VFS作为适配器,遮住了具体文件系统之间的差异,对外提供统一的文件操作接口抽象。</p> <p>VFS是DragonOS文件系统的核心,它提供了一套统一的文件系统接口,使得DragonOS可以支持多种不同的文件系统。VFS的主要功能包括:</p> <blockquote><p>提供统一的文件系统接口</p> <p>提供文件系统的挂载和卸载机制(MountFS)</p> <p>提供文件抽象(File)</p> <p>提供文件系统的抽象(FileSystem)</p> <p>提供IndexNode抽象</p></blockquote> <h2 id="vfs的架构设计"><a href="#vfs的架构设计" class="header-anchor">#</a> VFS的架构设计</h2> <p><img src="/OS_lab_tutorial/assets/img/vfs_archi_design.7880906d.png" alt="图片2" title="vfs架构设计"></p> <h3 id="file"><a href="#file" class="header-anchor">#</a> File</h3> <p><code>File</code>结构体是VFS中最基本的抽象,它代表了一个打开的文件。每当进程打开了一个文件,就会创建一个File结构体,用于维护该文件的状态信息。</p> <div class="language-rust extra-class"><pre class="language-rust"><code><span class="token comment">/// @brief 抽象文件结构体</span>
- <span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">File</span> <span class="token punctuation">{</span>
- inode<span class="token punctuation">:</span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token keyword">dyn</span> <span class="token class-name">IndexNode</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token comment">/// 对于文件,表示字节偏移量;对于文件夹,表示当前操作的子目录项偏移量</span>
- offset<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- <span class="token comment">/// 文件的打开模式</span>
- mode<span class="token punctuation">:</span> <span class="token class-name">FileMode</span><span class="token punctuation">,</span>
- <span class="token comment">/// 文件类型</span>
- file_type<span class="token punctuation">:</span> <span class="token class-name">FileType</span><span class="token punctuation">,</span>
- <span class="token comment">/// readdir时候用的,暂存的本次循环中,所有子目录项的名字的数组</span>
- readdir_subdirs_name<span class="token punctuation">:</span> <span class="token class-name">Vec</span><span class="token operator"><</span><span class="token class-name">String</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token keyword">pub</span> private_data<span class="token punctuation">:</span> <span class="token class-name">FilePrivateData</span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span>
- </code></pre></div><h3 id="traits"><a href="#traits" class="header-anchor">#</a> Traits</h3> <p>对于每个具体文件系统,都需要实现以下的trait:</p> <p>FileSystem:表明某个struct是一个文件系统</p> <div class="language-rust extra-class"><pre class="language-rust"><code><span class="token keyword">pub</span> <span class="token keyword">trait</span> <span class="token type-definition class-name">FileSystem</span><span class="token punctuation">:</span> <span class="token class-name">Any</span> <span class="token operator">+</span> <span class="token class-name">Sync</span> <span class="token operator">+</span> <span class="token class-name">Send</span> <span class="token operator">+</span> <span class="token class-name">Debug</span> <span class="token punctuation">{</span>
- <span class="token comment">/// @brief 获取当前文件系统的root inode的指针</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">root_inode</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token keyword">dyn</span> <span class="token class-name">IndexNode</span><span class="token operator">></span><span class="token punctuation">;</span>
- <span class="token comment">/// @brief 获取当前文件系统的信息</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">info</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">FsInfo</span><span class="token punctuation">;</span>
- <span class="token comment">/// @brief 本函数用于实现动态转换。</span>
- <span class="token comment">/// 具体的文件系统在实现本函数时,最简单的方式就是:直接返回self</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">as_any_ref</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token operator">&</span><span class="token keyword">dyn</span> <span class="token class-name">Any</span><span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- </code></pre></div><p><code>IndexNode</code>: 表明某个struct是一个索引节点</p> <div class="language-rust extra-class"><pre class="language-rust"><code><span class="token keyword">pub</span> <span class="token keyword">trait</span> <span class="token type-definition class-name">IndexNode</span><span class="token punctuation">:</span> <span class="token class-name">Any</span> <span class="token operator">+</span> <span class="token class-name">Sync</span> <span class="token operator">+</span> <span class="token class-name">Send</span> <span class="token operator">+</span> <span class="token class-name">Debug</span> <span class="token punctuation">{</span>
- <span class="token comment">/// 以下陈列部分函数</span>
- <span class="token comment">/// @brief 打开文件</span>
- <span class="token comment">/// @return 成功:Ok()</span>
- <span class="token comment">/// 失败:Err(错误码)</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">open</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">,</span> _data<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">mut</span> <span class="token class-name">FilePrivateData</span><span class="token punctuation">,</span> _mode<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token class-name">FileMode</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Result</span><span class="token operator"><</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token class-name">SystemError</span><span class="token operator">></span> <span class="token punctuation">{</span>
- <span class="token comment">// 若文件系统没有实现此方法,则返回“不支持”</span>
- <span class="token keyword">return</span> <span class="token class-name">Err</span><span class="token punctuation">(</span><span class="token class-name">SystemError</span><span class="token punctuation">::</span><span class="token constant">EOPNOTSUPP_OR_ENOTSUP</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- <span class="token comment">/// @brief 关闭文件</span>
- <span class="token comment">/// @return 成功:Ok()</span>
- <span class="token comment">/// 失败:Err(错误码)</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">close</span><span class="token punctuation">(</span><span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">,</span> _data<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">mut</span> <span class="token class-name">FilePrivateData</span><span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Result</span><span class="token operator"><</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token class-name">SystemError</span><span class="token operator">></span> <span class="token punctuation">{</span>
- <span class="token comment">// 若文件系统没有实现此方法,则返回“不支持”</span>
- <span class="token keyword">return</span> <span class="token class-name">Err</span><span class="token punctuation">(</span><span class="token class-name">SystemError</span><span class="token punctuation">::</span><span class="token constant">EOPNOTSUPP_OR_ENOTSUP</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- <span class="token comment">/// @brief 在inode的指定偏移量开始,读取指定大小的数据</span>
- <span class="token comment">/// @param offset 起始位置在Inode中的偏移量</span>
- <span class="token comment">/// @param len 要读取的字节数</span>
- <span class="token comment">/// @param buf 缓冲区. 请注意,必须满足@buf.len()>=@len</span>
- <span class="token comment">/// @param _data 各文件系统系统所需私有信息</span>
- <span class="token comment">/// @return 成功:Ok(读取的字节数)</span>
- <span class="token comment">/// 失败:Err(Posix错误码)</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">read_at</span><span class="token punctuation">(</span>
- <span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">,</span>
- offset<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- len<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- buf<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">mut</span> <span class="token punctuation">[</span><span class="token keyword">u8</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
- _data<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">mut</span> <span class="token class-name">FilePrivateData</span><span class="token punctuation">,</span>
- <span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Result</span><span class="token operator"><</span><span class="token keyword">usize</span><span class="token punctuation">,</span> <span class="token class-name">SystemError</span><span class="token operator">></span><span class="token punctuation">;</span>
- <span class="token comment">/// @brief 在inode的指定偏移量开始,写入指定大小的数据(从buf的第0byte开始写入)</span>
- <span class="token comment">/// @param offset 起始位置在Inode中的偏移量</span>
- <span class="token comment">/// @param len 要写入的字节数</span>
- <span class="token comment">/// @param buf 缓冲区. 请注意,必须满足@buf.len()>=@len</span>
- <span class="token comment">/// @param _data 各文件系统系统所需私有信息</span>
- <span class="token comment">/// @return 成功:Ok(写入的字节数)</span>
- <span class="token comment">/// 失败:Err(Posix错误码)</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">write_at</span><span class="token punctuation">(</span>
- <span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">,</span>
- offset<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- len<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- buf<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token punctuation">[</span><span class="token keyword">u8</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
- _data<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">mut</span> <span class="token class-name">FilePrivateData</span><span class="token punctuation">,</span>
- <span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Result</span><span class="token operator"><</span><span class="token keyword">usize</span><span class="token punctuation">,</span> <span class="token class-name">SystemError</span><span class="token operator">></span><span class="token punctuation">;</span>
- <span class="token comment">/// @brief 在当前目录下创建一个新的inode,并传入一个简单的data字段,方便进行初始化。</span>
- <span class="token comment">/// @param name 目录项的名字</span>
- <span class="token comment">/// @param file_type 文件类型</span>
- <span class="token comment">/// @param mode 权限</span>
- <span class="token comment">/// @param data 用于初始化该inode的数据。(为0则表示忽略此字段)对于不同的文件系统来说,代表的含义可能不同。</span>
- <span class="token comment">/// @return 创建成功:返回Ok(新的inode的Arc指针)</span>
- <span class="token comment">/// @return 创建失败:返回Err(错误码)</span>
- <span class="token keyword">fn</span> <span class="token function-definition function">create_with_data</span><span class="token punctuation">(</span>
- <span class="token operator">&</span><span class="token keyword">self</span><span class="token punctuation">,</span>
- _name<span class="token punctuation">:</span> <span class="token operator">&</span><span class="token keyword">str</span><span class="token punctuation">,</span>
- _file_type<span class="token punctuation">:</span> <span class="token class-name">FileType</span><span class="token punctuation">,</span>
- _mode<span class="token punctuation">:</span> <span class="token keyword">u32</span><span class="token punctuation">,</span>
- _data<span class="token punctuation">:</span> <span class="token keyword">usize</span><span class="token punctuation">,</span>
- <span class="token punctuation">)</span> <span class="token punctuation">-></span> <span class="token class-name">Result</span><span class="token operator"><</span><span class="token class-name">Arc</span><span class="token operator"><</span><span class="token keyword">dyn</span> <span class="token class-name">IndexNode</span><span class="token operator">></span><span class="token punctuation">,</span> <span class="token class-name">SystemError</span><span class="token operator">></span> <span class="token punctuation">{</span>
- <span class="token comment">// 若文件系统没有实现此方法,则返回“不支持”</span>
- <span class="token keyword">return</span> <span class="token class-name">Err</span><span class="token punctuation">(</span><span class="token class-name">SystemError</span><span class="token punctuation">::</span><span class="token constant">EOPNOTSUPP_OR_ENOTSUP</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
- <span class="token punctuation">}</span>
- <span class="token punctuation">...</span>
- <span class="token punctuation">}</span>
- </code></pre></div><p>一般情况下,FileSystem和IndexNode是一对一的关系,也就是,一个文件系统对应一种IndexNode。但是,对于某些特殊的文件系统,比如DevFS,根据不同的设备类型,会有不同的IndexNode,因此,FileSystem和IndexNode是一对多的关系。</p> <h3 id="mountfs"><a href="#mountfs" class="header-anchor">#</a> MountFS</h3> <p><code>挂载文件系统</code>是将一个磁盘分区或者远程的存储设备连接到计算机文件系统中的一个过程。当我们需要访问一个磁盘分区或者远程存储设备时,首先要确定其所属的文件系统类型,然后再将它挂载到指定的目录下。这样,在访问该目录时就可以直接读取或写入外部设备上的数据了。</p> <div class="language-rust extra-class"><pre class="language-rust"><code><span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">MountFS</span> <span class="token punctuation">{</span>
- <span class="token comment">// MountFS内部的文件系统</span>
- inner_filesystem<span class="token punctuation">:</span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token keyword">dyn</span> <span class="token class-name">FileSystem</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token comment">/// 用来存储InodeID->挂载点的MountFS的B树</span>
- mountpoints<span class="token punctuation">:</span> <span class="token class-name">SpinLock</span><span class="token operator"><</span><span class="token class-name">BTreeMap</span><span class="token operator"><</span><span class="token class-name">InodeId</span><span class="token punctuation">,</span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token class-name">MountFS</span><span class="token operator">>></span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token comment">/// 当前文件系统挂载到的那个挂载点的Inode</span>
- self_mountpoint<span class="token punctuation">:</span> <span class="token class-name">Option</span><span class="token operator"><</span><span class="token class-name">Arc</span><span class="token operator"><</span><span class="token class-name">MountFSInode</span><span class="token operator">>></span><span class="token punctuation">,</span>
- <span class="token comment">/// 指向当前MountFS的弱引用</span>
- self_ref<span class="token punctuation">:</span> <span class="token class-name">Weak</span><span class="token operator"><</span><span class="token class-name">MountFS</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span>
- </code></pre></div><div class="language-rust extra-class"><pre class="language-rust"><code><span class="token comment">/// @brief MountFS的Index Node </span>
- <span class="token comment">/// 注意,这个IndexNode只是一个中间层。它的目的是将具体文件系统的Inode与挂载机制连接在一起。</span>
- <span class="token keyword">pub</span> <span class="token keyword">struct</span> <span class="token type-definition class-name">MountFSInode</span> <span class="token punctuation">{</span>
- <span class="token comment">/// 当前挂载点对应到具体的文件系统的Inode</span>
- inner_inode<span class="token punctuation">:</span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token keyword">dyn</span> <span class="token class-name">IndexNode</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token comment">/// 当前Inode对应的MountFS</span>
- mount_fs<span class="token punctuation">:</span> <span class="token class-name">Arc</span><span class="token operator"><</span><span class="token class-name">MountFS</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token comment">/// 指向自身的弱引用</span>
- self_ref<span class="token punctuation">:</span> <span class="token class-name">Weak</span><span class="token operator"><</span><span class="token class-name">MountFSInode</span><span class="token operator">></span><span class="token punctuation">,</span>
- <span class="token punctuation">}</span>
- </code></pre></div><p>虽然其实现了FileSystem和IndexNode这两个trait,但它并不是一个“文件系统”,而是一种机制,用于将不同的文件系统挂载到同一个文件系统树上。所有的文件系统要挂载到文件系统树上,都需要通过<code>MountFS</code>来完成。也就是说,挂载树上的每个文件系统结构体的外面,都套了一层MountFS结构体。</p> <p>对于大部分的操作,MountFS都是直接转发给具体的文件系统,而不做任何处理。同时,为了支持跨文件系统的操作,比如在目录树上查找,每次<code>lookup</code>操作或者是<code>find</code>操作,都会通过<code>MountFSInode</code>的对应方法,判断当前inode是否为挂载点,并对挂载点进行特殊处理。如果发现操作跨越了具体文件系统的边界,MountFS就会将操作转发给下一个文件系统,并执行Inode替换。这个功能的实现,也是通过在普通的Inode结构体外面,套一层MountFSInode结构体来实现的。</p> <h2 id="ramfs"><a href="#ramfs" class="header-anchor">#</a> RamFS</h2> <p>ramfs是vfs下具体实现的一种基于RAM做存储的文件系统,主要实现了以下功能:</p> <ul><li><code>read_at</code>: 读</li> <li><code>write_at</code>: 写</li> <li><code>poll</code>: 获取文件状态</li> <li><code>resize</code>: 重置用于存放数据的data的大小</li> <li><code>create_with_data</code>: 创建自带数据的文件</li> <li><code>link**</code>: 链接</li> <li><code>unlink</code>: 解链接</li> <li><code>rmdir</code>: 删除文件夹</li> <li><code>move</code>: 移动文件</li> <li><code>find</code>: 查找文件</li> <li><code>list</code>: 显示当前文件夹下的内容</li></ul></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"></div></div>
- <script src="/OS_lab_tutorial/assets/js/app.de832b6b.js" defer></script><script src="/OS_lab_tutorial/assets/js/2.6cca19a7.js" defer></script><script src="/OS_lab_tutorial/assets/js/1.2e5d3cee.js" defer></script><script src="/OS_lab_tutorial/assets/js/21.160e1109.js" defer></script>
- </body>
- </html>
|