(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{294:function(s,t){s.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcYAAAHZCAYAAAAc4ptnAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAACL2SURBVHhe7d0vdxvXGi/g996vkIACSwfEq13roNIeuUDMHyEKcUhNYhyVGJnUwQ5JSEyqfAQzg1qntKhrtcsBlQIKUn7YvbOlkfTKsRz/j2M9T5Zaz8iSxlsz89vvnpHm//zvf//7fwEAjPzf+v8AQEUwAkAiGAEgEYwAkAhGAEgEIwAkghEAEsEIAIkP+N+kd/ux+awXg3oyVh5EvP+nnsia8Z9vB/Hf3+rJOSvxIN7HaY96uBLx4X09Meeb+Dr+iD/rqTkLl+Fh9Uofqlc6xbffRfO3X2d/R2IZxizD2OJlWLwef/Xvr+Lv3/+upzLLMLYEy9DqxsF2u574/ATjTSrB+FPE89cbsVrPAiA53In1o7U7FYyGUgEgEYwAkAhGAEgEIwAkghEAEsEIAImPawBAomIEgEQwAkAiGAEgEYw3qXwl3A/7cVxPAnBC+Uq4ncN64m4QjACQCEYASAQjACSCEQASwQgAiWAEgEQwAkAiGAEgEYwAkAhGAEgEIwAkghEAEhcqBoBExQgAiWAEgEQw3iTXYwQ4m+sxAsvu+M1mrOswcoedGYyjFXh9vb5txv67+o5bcxg7k9c/sSHlZbtjnQ24pOPY/+FzbGd3Q9mmN98sQ1wu3q9xNywOxqq83eq3Yu/gIA5Gt1ex8ai+79a0Y7u89stONOs5E6tPX42Wq9uqZwBfhNG2+3ojVuvp5bN4v8bdcPGh1HLcbH2n6vNMlF5uqtrKePGkN3Syypy7Lz3H3PzrqQDHFWVezvsq9T6r26THPfr7c0POvW/j92za5uds8LkRhNTTPdyp3uc3s/dwrtc/et36Men9KM+18ybdd+U3/bbaobzOTvX3njZiMf98+ekOd2bzT66Xs/u2ojesZ17abbRD+f2Tle1sXnmtzeq9/bgqWlA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q31/F37//XU9l190On2sZmtF5+So2HtWT51BOIJk1631ph+yal+Gq6/EJghEAEkOpAJAIRgBIBCMAJIIRABLBCACJYASARDACQCIYASARjAAwFfH/AVuCjI5UvnDMAAAAAElFTkSuQmCC"},295:function(s,t,a){s.exports=a.p+"assets/img/vfs_archi_design.7880906d.png"},325:function(s,t,a){"use strict";a.r(t);var n=a(14),e=Object(n.a)({},(function(){var s=this,t=s._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":s.$parent.slotKey}},[t("h1",{attrs:{id:"文件系统"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#文件系统"}},[s._v("#")]),s._v(" 文件系统")]),s._v(" "),t("h2",{attrs:{id:"本章导读"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#本章导读"}},[s._v("#")]),s._v(" 本章导读")]),s._v(" "),t("p",[s._v("本章意在介绍文件系统相关知识,包括虚拟文件系统、ramfs。")]),s._v(" "),t("h2",{attrs:{id:"dragonos文件系统的架构设计"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#dragonos文件系统的架构设计"}},[s._v("#")]),s._v(" DragonOS文件系统的架构设计")]),s._v(" "),t("p",[s._v("首先,我们来总览一下DragonOS文件系统的架构设计。相关的机制主要包括以下几个部分:")]),s._v(" "),t("blockquote",[t("ul",[t("li",[t("p",[s._v("系统调用接口")])]),s._v(" "),t("li",[t("p",[s._v("虚拟文件系统")])])]),s._v(" "),t("blockquote",[t("p",[s._v("文件抽象(File)")]),s._v(" "),t("p",[s._v("挂载文件系统(MountFS)")])]),s._v(" "),t("ul",[t("li",[s._v("具体的文件系统")])])]),s._v(" "),t("p",[s._v("如图所示:")]),s._v(" "),t("p",[t("img",{attrs:{src:a(294),alt:"图片1",title:"文件系统架构设计"}})]),s._v(" "),t("p",[s._v("其中我们可以看到,中间部分作为接口对多个并行的物理文件系统实例(每一个都叫做文件系统的实现)提供支持。这就是虚拟文件系统。")]),s._v(" "),t("h2",{attrs:{id:"虚拟文件系统"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#虚拟文件系统"}},[s._v("#")]),s._v(" 虚拟文件系统")]),s._v(" "),t("p",[t("code",[s._v("虚拟文件系统")]),s._v("(Virtual File System,缩写为"),t("code",[s._v("VFS")]),s._v(")是计算机操作系统中的一个抽象层,它提供了文件系统的标准化接口,使得应用程序可以通过统一的方式访问各种不同类型的文件系统。")]),s._v(" "),t("p",[s._v("其设计目的是将文件系统的实现细节与应用程序分离,使得应用程序可以独立于底层文件系统的具体实现方式。它定义了一组通用的文件操作接口,如打开文件、关闭文件、读取文件、写入文件等,应用程序可以通过这些接口来访问和操作文件,而无需关心文件系统的底层细节。例如,一个应用程序可以通过虚拟文件系统接口打开一个文件,而不需要关心这个文件是存储在本地磁盘上的普通文件,还是位于远程服务器上的网络文件。虚拟文件系统会将这些不同类型的文件系统映射到一个统一的文件层次结构中,使得应用程序可以以相同的方式访问这些文件。")]),s._v(" "),t("p",[s._v("在"),t("em",[s._v("DragonOS")]),s._v("中,VFS作为适配器,遮住了具体文件系统之间的差异,对外提供统一的文件操作接口抽象。")]),s._v(" "),t("p",[s._v("VFS是DragonOS文件系统的核心,它提供了一套统一的文件系统接口,使得DragonOS可以支持多种不同的文件系统。VFS的主要功能包括:")]),s._v(" "),t("blockquote",[t("p",[s._v("提供统一的文件系统接口")]),s._v(" "),t("p",[s._v("提供文件系统的挂载和卸载机制(MountFS)")]),s._v(" "),t("p",[s._v("提供文件抽象(File)")]),s._v(" "),t("p",[s._v("提供文件系统的抽象(FileSystem)")]),s._v(" "),t("p",[s._v("提供IndexNode抽象")])]),s._v(" "),t("h2",{attrs:{id:"vfs的架构设计"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#vfs的架构设计"}},[s._v("#")]),s._v(" VFS的架构设计")]),s._v(" "),t("p",[t("img",{attrs:{src:a(295),alt:"图片2",title:"vfs架构设计"}})]),s._v(" "),t("h3",{attrs:{id:"file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file"}},[s._v("#")]),s._v(" File")]),s._v(" "),t("p",[t("code",[s._v("File")]),s._v("结构体是VFS中最基本的抽象,它代表了一个打开的文件。每当进程打开了一个文件,就会创建一个File结构体,用于维护该文件的状态信息。")]),s._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 抽象文件结构体")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("struct")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[s._v("File")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n inode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("IndexNode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 对于文件,表示字节偏移量;对于文件夹,表示当前操作的子目录项偏移量")]),s._v("\n offset"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 文件的打开模式")]),s._v("\n mode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FileMode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 文件类型")]),s._v("\n file_type"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FileType")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// readdir时候用的,暂存的本次循环中,所有子目录项的名字的数组")]),s._v("\n readdir_subdirs_name"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Vec")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("String")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" private_data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FilePrivateData")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),t("h3",{attrs:{id:"traits"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#traits"}},[s._v("#")]),s._v(" Traits")]),s._v(" "),t("p",[s._v("对于每个具体文件系统,都需要实现以下的trait:")]),s._v(" "),t("p",[s._v("FileSystem:表明某个struct是一个文件系统")]),s._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("trait")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[s._v("FileSystem")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Any")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Sync")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Send")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Debug")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 获取当前文件系统的root inode的指针")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("root_inode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("IndexNode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 获取当前文件系统的信息")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("info")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FsInfo")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 本函数用于实现动态转换。")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 具体的文件系统在实现本函数时,最简单的方式就是:直接返回self")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("as_any_ref")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Any")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),t("p",[t("code",[s._v("IndexNode")]),s._v(": 表明某个struct是一个索引节点")]),s._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("trait")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[s._v("IndexNode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Any")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Sync")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Send")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("+")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Debug")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 以下陈列部分函数")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 打开文件")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 成功:Ok()")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 失败:Err(错误码)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("open")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" _data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("mut")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FilePrivateData")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" _mode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FileMode")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Result")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 若文件系统没有实现此方法,则返回“不支持”")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Err")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[s._v("EOPNOTSUPP_OR_ENOTSUP")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 关闭文件")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 成功:Ok()")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 失败:Err(错误码)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("close")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" _data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("mut")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FilePrivateData")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Result")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 若文件系统没有实现此方法,则返回“不支持”")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Err")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[s._v("EOPNOTSUPP_OR_ENOTSUP")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 在inode的指定偏移量开始,读取指定大小的数据")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param offset 起始位置在Inode中的偏移量")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param len 要读取的字节数")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param buf 缓冲区. 请注意,必须满足@buf.len()>=@len")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param _data 各文件系统系统所需私有信息")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 成功:Ok(读取的字节数)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 失败:Err(Posix错误码)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("read_at")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n offset"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n len"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n buf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("mut")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("u8")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("mut")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FilePrivateData")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Result")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 在inode的指定偏移量开始,写入指定大小的数据(从buf的第0byte开始写入)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param offset 起始位置在Inode中的偏移量")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param len 要写入的字节数")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param buf 缓冲区. 请注意,必须满足@buf.len()>=@len")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param _data 各文件系统系统所需私有信息")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 成功:Ok(写入的字节数)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 失败:Err(Posix错误码)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("write_at")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n offset"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n len"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n buf"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("[")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("u8")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("]")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("mut")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FilePrivateData")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Result")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief 在当前目录下创建一个新的inode,并传入一个简单的data字段,方便进行初始化。")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param name 目录项的名字")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param file_type 文件类型")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param mode 权限")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @param data 用于初始化该inode的数据。(为0则表示忽略此字段)对于不同的文件系统来说,代表的含义可能不同。")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 创建成功:返回Ok(新的inode的Arc指针)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @return 创建失败:返回Err(错误码)")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("fn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token function-definition function"}},[s._v("create_with_data")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("self")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _name"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("&")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("str")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _file_type"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FileType")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _mode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("u32")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n _data"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("usize")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("->")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Result")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("IndexNode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// 若文件系统没有实现此方法,则返回“不支持”")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("return")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Err")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("(")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SystemError")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("::")]),t("span",{pre:!0,attrs:{class:"token constant"}},[s._v("EOPNOTSUPP_OR_ENOTSUP")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(")")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(";")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n\n "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("...")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),t("p",[s._v("一般情况下,FileSystem和IndexNode是一对一的关系,也就是,一个文件系统对应一种IndexNode。但是,对于某些特殊的文件系统,比如DevFS,根据不同的设备类型,会有不同的IndexNode,因此,FileSystem和IndexNode是一对多的关系。")]),s._v(" "),t("h3",{attrs:{id:"mountfs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mountfs"}},[s._v("#")]),s._v(" MountFS")]),s._v(" "),t("p",[t("code",[s._v("挂载文件系统")]),s._v("是将一个磁盘分区或者远程的存储设备连接到计算机文件系统中的一个过程。当我们需要访问一个磁盘分区或者远程存储设备时,首先要确定其所属的文件系统类型,然后再将它挂载到指定的目录下。这样,在访问该目录时就可以直接读取或写入外部设备上的数据了。")]),s._v(" "),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("struct")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[s._v("MountFS")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("// MountFS内部的文件系统")]),s._v("\n inner_filesystem"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("FileSystem")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 用来存储InodeID->挂载点的MountFS的B树")]),s._v("\n mountpoints"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("SpinLock")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("BTreeMap")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("InodeId")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MountFS")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">>")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 当前文件系统挂载到的那个挂载点的Inode")]),s._v("\n self_mountpoint"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Option")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MountFSInode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">>")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 指向当前MountFS的弱引用")]),s._v("\n self_ref"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Weak")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MountFS")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),t("div",{staticClass:"language-rust extra-class"},[t("pre",{pre:!0,attrs:{class:"language-rust"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// @brief MountFS的Index Node ")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 注意,这个IndexNode只是一个中间层。它的目的是将具体文件系统的Inode与挂载机制连接在一起。")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("pub")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("struct")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token type-definition class-name"}},[s._v("MountFSInode")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("{")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 当前挂载点对应到具体的文件系统的Inode")]),s._v("\n inner_inode"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token keyword"}},[s._v("dyn")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("IndexNode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 当前Inode对应的MountFS")]),s._v("\n mount_fs"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Arc")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MountFS")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n "),t("span",{pre:!0,attrs:{class:"token comment"}},[s._v("/// 指向自身的弱引用")]),s._v("\n self_ref"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(":")]),s._v(" "),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("Weak")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v("<")]),t("span",{pre:!0,attrs:{class:"token class-name"}},[s._v("MountFSInode")]),t("span",{pre:!0,attrs:{class:"token operator"}},[s._v(">")]),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v(",")]),s._v("\n"),t("span",{pre:!0,attrs:{class:"token punctuation"}},[s._v("}")]),s._v("\n")])])]),t("p",[s._v("虽然其实现了FileSystem和IndexNode这两个trait,但它并不是一个“文件系统”,而是一种机制,用于将不同的文件系统挂载到同一个文件系统树上。所有的文件系统要挂载到文件系统树上,都需要通过"),t("code",[s._v("MountFS")]),s._v("来完成。也就是说,挂载树上的每个文件系统结构体的外面,都套了一层MountFS结构体。")]),s._v(" "),t("p",[s._v("对于大部分的操作,MountFS都是直接转发给具体的文件系统,而不做任何处理。同时,为了支持跨文件系统的操作,比如在目录树上查找,每次"),t("code",[s._v("lookup")]),s._v("操作或者是"),t("code",[s._v("find")]),s._v("操作,都会通过"),t("code",[s._v("MountFSInode")]),s._v("的对应方法,判断当前inode是否为挂载点,并对挂载点进行特殊处理。如果发现操作跨越了具体文件系统的边界,MountFS就会将操作转发给下一个文件系统,并执行Inode替换。这个功能的实现,也是通过在普通的Inode结构体外面,套一层MountFSInode结构体来实现的。")]),s._v(" "),t("h2",{attrs:{id:"ramfs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ramfs"}},[s._v("#")]),s._v(" RamFS")]),s._v(" "),t("p",[s._v("ramfs是vfs下具体实现的一种基于RAM做存储的文件系统,主要实现了以下功能:")]),s._v(" "),t("ul",[t("li",[t("code",[s._v("read_at")]),s._v(": 读")]),s._v(" "),t("li",[t("code",[s._v("write_at")]),s._v(": 写")]),s._v(" "),t("li",[t("code",[s._v("poll")]),s._v(": 获取文件状态")]),s._v(" "),t("li",[t("code",[s._v("resize")]),s._v(": 重置用于存放数据的data的大小")]),s._v(" "),t("li",[t("code",[s._v("create_with_data")]),s._v(": 创建自带数据的文件")]),s._v(" "),t("li",[t("code",[s._v("link**")]),s._v(": 链接")]),s._v(" "),t("li",[t("code",[s._v("unlink")]),s._v(": 解链接")]),s._v(" "),t("li",[t("code",[s._v("rmdir")]),s._v(": 删除文件夹")]),s._v(" "),t("li",[t("code",[s._v("move")]),s._v(": 移动文件")]),s._v(" "),t("li",[t("code",[s._v("find")]),s._v(": 查找文件")]),s._v(" "),t("li",[t("code",[s._v("list")]),s._v(": 显示当前文件夹下的内容")])])])}),[],!1,null,null,null);t.default=e.exports}}]);