mirror of
https://github.com/rcore-os/rCore-Tutorial-v3.git
synced 2024-11-24 10:26:25 +04:00
deploy: 26404b4a0d
This commit is contained in:
parent
f2834a1f47
commit
ab15c04372
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,3 +1,3 @@
|
||||
(function() {var implementors = {};
|
||||
implementors["os"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/mm/frame_allocator/struct.FrameTracker.html\" title=\"struct os::mm::frame_allocator::FrameTracker\">FrameTracker</a>","synthetic":false,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl<'a, T> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/sync/up/struct.UPIntrRefMut.html\" title=\"struct os::sync::up::UPIntrRefMut\">UPIntrRefMut</a><'a, T>","synthetic":false,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.PidHandle.html\" title=\"struct os::task::id::PidHandle\">PidHandle</a>","synthetic":false,"types":["os::task::id::PidHandle"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.KernelStack.html\" title=\"struct os::task::id::KernelStack\">KernelStack</a>","synthetic":false,"types":["os::task::id::KernelStack"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.TaskUserRes.html\" title=\"struct os::task::id::TaskUserRes\">TaskUserRes</a>","synthetic":false,"types":["os::task::id::TaskUserRes"]}];
|
||||
implementors["os"] = [{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/fs/easy_fs/block_cache/struct.BlockCache.html\" title=\"struct os::fs::easy_fs::block_cache::BlockCache\">BlockCache</a>","synthetic":false,"types":["os::fs::easy_fs::block_cache::BlockCache"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/mm/frame_allocator/struct.FrameTracker.html\" title=\"struct os::mm::frame_allocator::FrameTracker\">FrameTracker</a>","synthetic":false,"types":["os::mm::frame_allocator::FrameTracker"]},{"text":"impl<'a, T> <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/sync/up/struct.UPIntrRefMut.html\" title=\"struct os::sync::up::UPIntrRefMut\">UPIntrRefMut</a><'a, T>","synthetic":false,"types":["os::sync::up::UPIntrRefMut"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.PidHandle.html\" title=\"struct os::task::id::PidHandle\">PidHandle</a>","synthetic":false,"types":["os::task::id::PidHandle"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.KernelStack.html\" title=\"struct os::task::id::KernelStack\">KernelStack</a>","synthetic":false,"types":["os::task::id::KernelStack"]},{"text":"impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"os/task/id/struct.TaskUserRes.html\" title=\"struct os::task::id::TaskUserRes\">TaskUserRes</a>","synthetic":false,"types":["os::task::id::TaskUserRes"]}];
|
||||
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,3 +0,0 @@
|
||||
(function() {var implementors = {};
|
||||
implementors["os"] = [{"text":"impl BlockDevice for <a class=\"struct\" href=\"os/drivers/block/virtio_blk/struct.VirtIOBlock.html\" title=\"struct os::drivers::block::virtio_blk::VirtIOBlock\">VirtIOBlock</a>","synthetic":false,"types":["os::drivers::block::virtio_blk::VirtIOBlock"]}];
|
||||
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,3 @@
|
||||
(function() {var implementors = {};
|
||||
implementors["os"] = [];
|
||||
if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})()
|
File diff suppressed because one or more lines are too long
@ -4,8 +4,8 @@
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../../index.html">os</a>::<wbr><a href="../index.html">drivers</a>::<wbr><a href="index.html">block</a>::<wbr><a class="struct" href="#">BLOCK_DEVICE</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct BLOCK_DEVICE {
|
||||
__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.__private_field" class="structfield small-section-header"><a href="#structfield.__private_field" class="anchor field"></a><code>__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a></code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Deref" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a></div><a href="#impl-Deref" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn BlockDevice></h4></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a></div><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn BlockDevice></h4></div></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.__private_field" class="structfield small-section-header"><a href="#structfield.__private_field" class="anchor field"></a><code>__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a></code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Deref" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a></div><a href="#impl-Deref" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../../fs/easy_fs/block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>></h4></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a></div><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../../fs/easy_fs/block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>></h4></div></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details><div id="impl-LazyStatic" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/drivers/block/mod.rs.html#12-14" title="goto source code">source</a></div><a href="#impl-LazyStatic" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BLOCK_DEVICE.html" title="struct os::drivers::block::BLOCK_DEVICE">BLOCK_DEVICE</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
|
File diff suppressed because one or more lines are too long
6
ch9-log/os/fs/easy_fs/bitmap/constant.BLOCK_BITS.html
Normal file
6
ch9-log/os/fs/easy_fs/bitmap/constant.BLOCK_BITS.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BLOCK_BITS` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BLOCK_BITS"><title>BLOCK_BITS in os::fs::easy_fs::bitmap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a></h2><div id="sidebar-vars" data-name="BLOCK_BITS" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a>::<wbr><a class="constant" href="#">BLOCK_BITS</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/bitmap.rs.html#6" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const BLOCK_BITS: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = BLOCK_SZ * 8; // 0x0000_0000_0000_1000usize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
7
ch9-log/os/fs/easy_fs/bitmap/fn.decomposition.html
Normal file
7
ch9-log/os/fs/easy_fs/bitmap/fn.decomposition.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Return (block_pos, bits64_pos, inner_pos)"><meta name="keywords" content="rust, rustlang, rust-lang, decomposition"><title>decomposition in os::fs::easy_fs::bitmap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a></h2><div id="sidebar-vars" data-name="decomposition" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a>::<wbr><a class="fn" href="#">decomposition</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/bitmap.rs.html#14-18" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>fn decomposition(bit: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.tuple.html">)</a></code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Return (block_pos, bits64_pos, inner_pos)</p>
|
||||
</div></details></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
11
ch9-log/os/fs/easy_fs/bitmap/index.html
Normal file
11
ch9-log/os/fs/easy_fs/bitmap/index.html
Normal file
@ -0,0 +1,11 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `bitmap` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, bitmap"><title>os::fs::easy_fs::bitmap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module bitmap</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="bitmap" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">bitmap</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/bitmap.rs.html#1-72" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Bitmap.html" title="os::fs::easy_fs::bitmap::Bitmap struct">Bitmap</a></div><div class="item-right docblock-short"></div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BLOCK_BITS.html" title="os::fs::easy_fs::bitmap::BLOCK_BITS constant">BLOCK_BITS</a></div><div class="item-right docblock-short"></div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.decomposition.html" title="os::fs::easy_fs::bitmap::decomposition fn">decomposition</a></div><div class="item-right docblock-short"><p>Return (block_pos, bits64_pos, inner_pos)</p>
|
||||
</div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.BitmapBlock.html" title="os::fs::easy_fs::bitmap::BitmapBlock type">BitmapBlock</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/bitmap/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/bitmap/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"constant":[["BLOCK_BITS",""]],"fn":[["decomposition","Return (block_pos, bits64_pos, inner_pos)"]],"struct":[["Bitmap",""]],"type":[["BitmapBlock",""]]});
|
18
ch9-log/os/fs/easy_fs/bitmap/struct.Bitmap.html
Normal file
18
ch9-log/os/fs/easy_fs/bitmap/struct.Bitmap.html
Normal file
File diff suppressed because one or more lines are too long
6
ch9-log/os/fs/easy_fs/bitmap/type.BitmapBlock.html
Normal file
6
ch9-log/os/fs/easy_fs/bitmap/type.BitmapBlock.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BitmapBlock` type in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BitmapBlock"><title>BitmapBlock in os::fs::easy_fs::bitmap - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Type Definition BitmapBlock</a></h2><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a></h2><div id="sidebar-vars" data-name="BitmapBlock" data-ty="type" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Type Definition <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">bitmap</a>::<wbr><a class="type" href="#">BitmapBlock</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/bitmap.rs.html#4" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust typedef"><code>type BitmapBlock = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u64.html">u64</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 64]</a>;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BLOCK_CACHE_SIZE` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BLOCK_CACHE_SIZE"><title>BLOCK_CACHE_SIZE in os::fs::easy_fs::block_cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a></h2><div id="sidebar-vars" data-name="BLOCK_CACHE_SIZE" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a>::<wbr><a class="constant" href="#">BLOCK_CACHE_SIZE</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#75" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const BLOCK_CACHE_SIZE: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 16;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `block_cache_sync_all` fn in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, block_cache_sync_all"><title>block_cache_sync_all in os::fs::easy_fs::block_cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a></h2><div id="sidebar-vars" data-name="block_cache_sync_all" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a>::<wbr><a class="fn" href="#">block_cache_sync_all</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#138-144" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn block_cache_sync_all()</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `get_block_cache` fn in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, get_block_cache"><title>get_block_cache in os::fs::easy_fs::block_cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc fn"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a></h2><div id="sidebar-vars" data-name="get_block_cache" data-ty="fn" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Function <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a>::<wbr><a class="fn" href="#">get_block_cache</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#128-136" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust fn"><code>pub fn get_block_cache(<br> block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <br> block_device: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>><br>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Mutex<<a class="struct" href="struct.BlockCache.html" title="struct os::fs::easy_fs::block_cache::BlockCache">BlockCache</a>>></code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
9
ch9-log/os/fs/easy_fs/block_cache/index.html
Normal file
9
ch9-log/os/fs/easy_fs/block_cache/index.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `block_cache` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, block_cache"><title>os::fs::easy_fs::block_cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module block_cache</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#constants">Constants</a></li><li><a href="#functions">Functions</a></li></ul></div><div id="sidebar-vars" data-name="block_cache" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">block_cache</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#1-144" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER struct">BLOCK_CACHE_MANAGER</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BlockCache.html" title="os::fs::easy_fs::block_cache::BlockCache struct">BlockCache</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.BlockCacheManager.html" title="os::fs::easy_fs::block_cache::BlockCacheManager struct">BlockCacheManager</a></div><div class="item-right docblock-short"></div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BLOCK_CACHE_SIZE.html" title="os::fs::easy_fs::block_cache::BLOCK_CACHE_SIZE constant">BLOCK_CACHE_SIZE</a></div><div class="item-right docblock-short"></div></div></div><h2 id="functions" class="small-section-header"><a href="#functions">Functions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.block_cache_sync_all.html" title="os::fs::easy_fs::block_cache::block_cache_sync_all fn">block_cache_sync_all</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="fn" href="fn.get_block_cache.html" title="os::fs::easy_fs::block_cache::get_block_cache fn">get_block_cache</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/block_cache/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/block_cache/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"constant":[["BLOCK_CACHE_SIZE",""]],"fn":[["block_cache_sync_all",""],["get_block_cache",""]],"struct":[["BLOCK_CACHE_MANAGER",""],["BlockCache",""],["BlockCacheManager",""]]});
|
@ -0,0 +1,49 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BLOCK_CACHE_MANAGER` struct in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BLOCK_CACHE_MANAGER"><title>BLOCK_CACHE_MANAGER in os::fs::easy_fs::block_cache - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Struct BLOCK_CACHE_MANAGER</a></h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.__private_field">__private_field</a></div><h3 class="sidebar-title"><a href="#deref-methods-Mutex%3CBlockCacheManager%3E">Methods from Deref<Target=Mutex<BlockCacheManager>></a></h3><div class="sidebar-links"><a href="#method.force_unlock">force_unlock</a><a href="#method.is_locked">is_locked</a><a href="#method.lock">lock</a><a href="#method.try_lock">try_lock</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-Deref">Deref</a><a href="#impl-LazyStatic">LazyStatic</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a></h2><div id="sidebar-vars" data-name="BLOCK_CACHE_MANAGER" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_cache</a>::<wbr><a class="struct" href="#">BLOCK_CACHE_MANAGER</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#123-126" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct BLOCK_CACHE_MANAGER {
|
||||
__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.__private_field" class="structfield small-section-header"><a href="#structfield.__private_field" class="anchor field"></a><code>__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a></code></span><h2 id="deref-methods-Mutex%3CBlockCacheManager%3E" class="small-section-header"><span>Methods from <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a><Target = Mutex<<a class="struct" href="struct.BlockCacheManager.html" title="struct os::fs::easy_fs::block_cache::BlockCacheManager">BlockCacheManager</a>>></span><a href="#deref-methods-Mutex%3CBlockCacheManager%3E" class="anchor"></a></h2><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.is_locked" class="method has-srclink"><div class="rightside"></div><a href="#method.is_locked" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_locked" class="fnname">is_locked</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div></summary><div class="docblock"><p>Returns <code>true</code> if the lock is currently held.</p>
|
||||
<h5 id="safety" class="section-header"><a href="#safety">Safety</a></h5>
|
||||
<p>This function provides no synchronization guarantees and so its result should be considered ‘out of date’
|
||||
the instant it is called. Do not use it for synchronization purposes. However, it may be useful as a heuristic.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.lock" class="method has-srclink"><div class="rightside"></div><a href="#method.lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.lock" class="fnname">lock</a>(&self) -> MutexGuard<'_, T></h4></div></summary><div class="docblock"><p>Locks the [<code>Mutex</code>] and returns a guard that permits access to the inner data.</p>
|
||||
<p>The returned value may be dereferenced for data access
|
||||
and the lock will be dropped when the guard falls out of scope.</p>
|
||||
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">0</span>);
|
||||
{
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">lock</span>();
|
||||
<span class="comment">// The lock is now locked and the data can be accessed</span>
|
||||
<span class="kw-2">*</span><span class="ident">data</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// The lock is implicitly dropped at the end of the scope</span>
|
||||
}</code></pre></div>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.force_unlock" class="method has-srclink"><div class="rightside"></div><a href="#method.force_unlock" class="anchor"></a><h4 class="code-header">pub unsafe fn <a href="#method.force_unlock" class="fnname">force_unlock</a>(&self)</h4></div></summary><div class="docblock"><p>Force unlock this [<code>Mutex</code>].</p>
|
||||
<h5 id="safety-1" class="section-header"><a href="#safety-1">Safety</a></h5>
|
||||
<p>This is <em>extremely</em> unsafe if the lock is not held by the current
|
||||
thread. However, this can be useful in some instances for exposing the
|
||||
lock to FFI that doesn’t know how to deal with RAII.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_lock" class="method has-srclink"><div class="rightside"></div><a href="#method.try_lock" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.try_lock" class="fnname">try_lock</a>(&self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a><MutexGuard<'_, T>></h4></div></summary><div class="docblock"><p>Try to lock this [<code>Mutex</code>], returning a lock guard if successful.</p>
|
||||
<h5 id="example" class="section-header"><a href="#example">Example</a></h5>
|
||||
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">let</span> <span class="ident">lock</span> <span class="op">=</span> <span class="ident">spin::Mutex::new</span>(<span class="number">42</span>);
|
||||
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard</span>.<span class="ident">is_some</span>());
|
||||
|
||||
<span class="comment">// `maybe_guard` is still held, so the second call fails</span>
|
||||
<span class="kw">let</span> <span class="ident">maybe_guard2</span> <span class="op">=</span> <span class="ident">lock</span>.<span class="ident">try_lock</span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">maybe_guard2</span>.<span class="ident">is_none</span>());</code></pre></div>
|
||||
</div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Deref" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#123-126" title="goto source code">source</a></div><a href="#impl-Deref" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = Mutex<<a class="struct" href="struct.BlockCacheManager.html" title="struct os::fs::easy_fs::block_cache::BlockCacheManager">BlockCacheManager</a>></h4></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#123-126" title="goto source code">source</a></div><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &Mutex<<a class="struct" href="struct.BlockCacheManager.html" title="struct os::fs::easy_fs::block_cache::BlockCacheManager">BlockCacheManager</a>></h4></div></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details><div id="impl-LazyStatic" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_cache.rs.html#123-126" title="goto source code">source</a></div><a href="#impl-LazyStatic" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.BLOCK_CACHE_MANAGER.html" title="struct os::fs::easy_fs::block_cache::BLOCK_CACHE_MANAGER">BLOCK_CACHE_MANAGER</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549-553" title="goto source code">source</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#550" title="goto source code">source</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#537-544" title="goto source code">source</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541" title="goto source code">source</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">source</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595" title="goto source code">source</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574-583" title="goto source code">source</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#580" title="goto source code">source</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
22
ch9-log/os/fs/easy_fs/block_cache/struct.BlockCache.html
Normal file
22
ch9-log/os/fs/easy_fs/block_cache/struct.BlockCache.html
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
7
ch9-log/os/fs/easy_fs/block_dev/index.html
Normal file
7
ch9-log/os/fs/easy_fs/block_dev/index.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `block_dev` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, block_dev"><title>os::fs::easy_fs::block_dev - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module block_dev</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="block_dev" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">block_dev</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_dev.rs.html#1-7" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.BlockDevice.html" title="os::fs::easy_fs::block_dev::BlockDevice trait">BlockDevice</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/block_dev/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/block_dev/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"trait":[["BlockDevice",""]]});
|
10
ch9-log/os/fs/easy_fs/block_dev/trait.BlockDevice.html
Normal file
10
ch9-log/os/fs/easy_fs/block_dev/trait.BlockDevice.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BlockDevice` trait in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BlockDevice"><title>BlockDevice in os::fs::easy_fs::block_dev - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Trait BlockDevice</a></h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.handle_irq">handle_irq</a><a href="#tymethod.read_block">read_block</a><a href="#tymethod.write_block">write_block</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_dev</a></h2><div id="sidebar-vars" data-name="BlockDevice" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Trait <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">block_dev</a>::<wbr><a class="trait" href="#">BlockDevice</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_dev.rs.html#3-7" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust trait"><code>pub trait BlockDevice: <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> + <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> {
|
||||
fn <a href="#tymethod.read_block" class="fnname">read_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>);
|
||||
<div class="item-spacer"></div> fn <a href="#tymethod.write_block" class="fnname">write_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>);
|
||||
<div class="item-spacer"></div> fn <a href="#tymethod.handle_irq" class="fnname">handle_irq</a>(&self);
|
||||
}</code></pre></div><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><div id="tymethod.read_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_dev.rs.html#4" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.read_block" class="fnname">read_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>)</h4></div><div id="tymethod.write_block" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_dev.rs.html#5" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.write_block" class="fnname">write_block</a>(&self, block_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>)</h4></div><div id="tymethod.handle_irq" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/block_dev.rs.html#6" title="goto source code">source</a></div><h4 class="code-header">fn <a href="#tymethod.handle_irq" class="fnname">handle_irq</a>(&self)</h4></div></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-BlockDevice" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/drivers/block/virtio_blk.rs.html#26-76" title="goto source code">source</a></div><a href="#impl-BlockDevice" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a> for <a class="struct" href="../../../drivers/block/virtio_blk/struct.VirtIOBlock.html" title="struct os::drivers::block::virtio_blk::VirtIOBlock">VirtIOBlock</a></h3></div></div><script type="text/javascript" src="../../../../implementors/os/fs/easy_fs/block_dev/trait.BlockDevice.js" async></script></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
6
ch9-log/os/fs/easy_fs/constant.BLOCK_SZ.html
Normal file
6
ch9-log/os/fs/easy_fs/constant.BLOCK_SZ.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `BLOCK_SZ` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, BLOCK_SZ"><title>BLOCK_SZ in os::fs::easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../index.html">os</a>::<wbr><a href="../index.html">fs</a>::<wbr><a href="index.html">easy_fs</a></h2><div id="sidebar-vars" data-name="BLOCK_SZ" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../index.html">os</a>::<wbr><a href="../index.html">fs</a>::<wbr><a href="index.html">easy_fs</a>::<wbr><a class="constant" href="#">BLOCK_SZ</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/fs/easy_fs/mod.rs.html#12" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BLOCK_SZ: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 512;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
8
ch9-log/os/fs/easy_fs/efs/index.html
Normal file
8
ch9-log/os/fs/easy_fs/efs/index.html
Normal file
@ -0,0 +1,8 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `efs` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, efs"><title>os::fs::easy_fs::efs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module efs</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="efs" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">efs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/efs.rs.html#1-158" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.EasyFileSystem.html" title="os::fs::easy_fs::efs::EasyFileSystem struct">EasyFileSystem</a></div><div class="item-right docblock-short"></div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.DataBlock.html" title="os::fs::easy_fs::efs::DataBlock type">DataBlock</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/efs/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/efs/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"struct":[["EasyFileSystem",""]],"type":[["DataBlock",""]]});
|
22
ch9-log/os/fs/easy_fs/efs/struct.EasyFileSystem.html
Normal file
22
ch9-log/os/fs/easy_fs/efs/struct.EasyFileSystem.html
Normal file
File diff suppressed because one or more lines are too long
6
ch9-log/os/fs/easy_fs/efs/type.DataBlock.html
Normal file
6
ch9-log/os/fs/easy_fs/efs/type.DataBlock.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DataBlock` type in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DataBlock"><title>DataBlock in os::fs::easy_fs::efs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Type Definition DataBlock</a></h2><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">efs</a></h2><div id="sidebar-vars" data-name="DataBlock" data-ty="type" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Type Definition <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">efs</a>::<wbr><a class="type" href="#">DataBlock</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/efs.rs.html#17" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust typedef"><code>type DataBlock = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 512]</a>;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
9
ch9-log/os/fs/easy_fs/index.html
Normal file
9
ch9-log/os/fs/easy_fs/index.html
Normal file
@ -0,0 +1,9 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `easy_fs` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, easy_fs"><title>os::fs::easy_fs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script src="../../../crates.js"></script><script defer src="../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module easy_fs</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#constants">Constants</a></li></ul></div><div id="sidebar-vars" data-name="easy_fs" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../os/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../index.html">os</a>::<wbr><a href="../index.html">fs</a>::<wbr><a class="mod" href="#">easy_fs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/fs/easy_fs/mod.rs.html#5-18" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left import-item"><code>pub use bitmap::<a class="struct" href="bitmap/struct.Bitmap.html" title="struct os::fs::easy_fs::bitmap::Bitmap">Bitmap</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use block_cache::<a class="fn" href="block_cache/fn.block_cache_sync_all.html" title="fn os::fs::easy_fs::block_cache::block_cache_sync_all">block_cache_sync_all</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use block_cache::<a class="fn" href="block_cache/fn.get_block_cache.html" title="fn os::fs::easy_fs::block_cache::get_block_cache">get_block_cache</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use block_dev::<a class="trait" href="block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use efs::<a class="struct" href="efs/struct.EasyFileSystem.html" title="struct os::fs::easy_fs::efs::EasyFileSystem">EasyFileSystem</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use <a class="mod" href="layout/index.html" title="mod os::fs::easy_fs::layout">layout</a>::*;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use vfs::<a class="struct" href="vfs/struct.Inode.html" title="struct os::fs::easy_fs::vfs::Inode">Inode</a>;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="bitmap/index.html" title="os::fs::easy_fs::bitmap mod">bitmap</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="block_cache/index.html" title="os::fs::easy_fs::block_cache mod">block_cache</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="block_dev/index.html" title="os::fs::easy_fs::block_dev mod">block_dev</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="efs/index.html" title="os::fs::easy_fs::efs mod">efs</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="layout/index.html" title="os::fs::easy_fs::layout mod">layout</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="vfs/index.html" title="os::fs::easy_fs::vfs mod">vfs</a></div><div class="item-right docblock-short"></div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.BLOCK_SZ.html" title="os::fs::easy_fs::BLOCK_SZ constant">BLOCK_SZ</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
6
ch9-log/os/fs/easy_fs/layout/constant.DIRECT_BOUND.html
Normal file
6
ch9-log/os/fs/easy_fs/layout/constant.DIRECT_BOUND.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DIRECT_BOUND` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DIRECT_BOUND"><title>DIRECT_BOUND in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="DIRECT_BOUND" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">DIRECT_BOUND</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#11" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const DIRECT_BOUND: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = INODE_DIRECT_COUNT; // 0x0000_0000_0000_001cusize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
6
ch9-log/os/fs/easy_fs/layout/constant.DIRENT_SZ.html
Normal file
6
ch9-log/os/fs/easy_fs/layout/constant.DIRENT_SZ.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DIRENT_SZ` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DIRENT_SZ"><title>DIRENT_SZ in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="DIRENT_SZ" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">DIRENT_SZ</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#387" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const DIRENT_SZ: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 32;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
6
ch9-log/os/fs/easy_fs/layout/constant.EFS_MAGIC.html
Normal file
6
ch9-log/os/fs/easy_fs/layout/constant.EFS_MAGIC.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `EFS_MAGIC` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, EFS_MAGIC"><title>EFS_MAGIC in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="EFS_MAGIC" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">EFS_MAGIC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#6" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const EFS_MAGIC: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a> = 0x3b800001;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `INDIRECT1_BOUND` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, INDIRECT1_BOUND"><title>INDIRECT1_BOUND in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="INDIRECT1_BOUND" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">INDIRECT1_BOUND</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#12" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const INDIRECT1_BOUND: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = DIRECT_BOUND + INODE_INDIRECT1_COUNT; // 0x0000_0000_0000_009cusize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `INDIRECT2_BOUND` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, INDIRECT2_BOUND"><title>INDIRECT2_BOUND in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="INDIRECT2_BOUND" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">INDIRECT2_BOUND</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#14" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const INDIRECT2_BOUND: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = INDIRECT1_BOUND + INODE_INDIRECT2_COUNT; // 0x0000_0000_0000_409cusize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `INODE_DIRECT_COUNT` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, INODE_DIRECT_COUNT"><title>INODE_DIRECT_COUNT in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="INODE_DIRECT_COUNT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">INODE_DIRECT_COUNT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#7" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const INODE_DIRECT_COUNT: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 28;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `INODE_INDIRECT1_COUNT` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, INODE_INDIRECT1_COUNT"><title>INODE_INDIRECT1_COUNT in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="INODE_INDIRECT1_COUNT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">INODE_INDIRECT1_COUNT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#9" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const INODE_INDIRECT1_COUNT: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = BLOCK_SZ / 4; // 0x0000_0000_0000_0080usize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `INODE_INDIRECT2_COUNT` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, INODE_INDIRECT2_COUNT"><title>INODE_INDIRECT2_COUNT in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="INODE_INDIRECT2_COUNT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">INODE_INDIRECT2_COUNT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#10" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const INODE_INDIRECT2_COUNT: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = INODE_INDIRECT1_COUNT * INODE_INDIRECT1_COUNT; // 0x0000_0000_0000_4000usize</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `NAME_LENGTH_LIMIT` constant in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, NAME_LENGTH_LIMIT"><title>NAME_LENGTH_LIMIT in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="NAME_LENGTH_LIMIT" data-ty="constant" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="constant" href="#">NAME_LENGTH_LIMIT</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#8" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>const NAME_LENGTH_LIMIT: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a> = 27;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
21
ch9-log/os/fs/easy_fs/layout/enum.DiskInodeType.html
Normal file
21
ch9-log/os/fs/easy_fs/layout/enum.DiskInodeType.html
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DiskInodeType` enum in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DiskInodeType"><title>DiskInodeType in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc enum"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Enum DiskInodeType</a></h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#variants">Variants</a></h3><div class="sidebar-links"><a href="#variant.Directory">Directory</a><a href="#variant.File">File</a></div><h3 class="sidebar-title"><a href="#trait-implementations">Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-PartialEq%3CDiskInodeType%3E">PartialEq<DiskInodeType></a><a href="#impl-StructuralPartialEq">StructuralPartialEq</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="DiskInodeType" data-ty="enum" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Enum <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="enum" href="#">DiskInodeType</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#63-66" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust enum"><code>pub enum DiskInodeType {
|
||||
File,
|
||||
Directory,
|
||||
}</code></pre></div><h2 id="variants" class="variants small-section-header">Variants<a href="#variants" class="anchor"></a></h2><h3 id="variant.File" class="variant small-section-header"><a href="#variant.File" class="anchor field"></a><code>File</code></h3><h3 id="variant.Directory" class="variant small-section-header"><a href="#variant.Directory" class="anchor field"></a><code>Directory</code></h3><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-PartialEq%3CDiskInodeType%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#62" title="goto source code">source</a></div><a href="#impl-PartialEq%3CDiskInodeType%3E" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html" title="trait core::cmp::PartialEq">PartialEq</a><<a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a>> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.eq" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#62" title="goto source code">source</a></div><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq" class="fnname">eq</a>(&self, other: &<a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div></summary><div class='docblock'><p>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
|
||||
by <code>==</code>. <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#tymethod.eq">Read more</a></p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.ne" class="method trait-impl has-srclink"><div class="rightside"><span class="since" title="Stable since Rust version 1.0.0">1.0.0</span> · <a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/cmp.rs.html#219" title="goto source code">source</a></div><a href="#method.ne" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/cmp/trait.PartialEq.html#method.ne" class="fnname">ne</a>(&self, other: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>Rhs) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div></summary><div class='docblock'><p>This method tests for <code>!=</code>.</p>
|
||||
</div></details></div></details><div id="impl-StructuralPartialEq" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#62" title="goto source code">source</a></div><a href="#impl-StructuralPartialEq" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.StructuralPartialEq.html" title="trait core::marker::StructuralPartialEq">StructuralPartialEq</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549-553" title="goto source code">source</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#550" title="goto source code">source</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#537-544" title="goto source code">source</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541" title="goto source code">source</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">source</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595" title="goto source code">source</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574-583" title="goto source code">source</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#580" title="goto source code">source</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
10
ch9-log/os/fs/easy_fs/layout/index.html
Normal file
10
ch9-log/os/fs/easy_fs/layout/index.html
Normal file
@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `layout` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, layout"><title>os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module layout</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li><li><a href="#constants">Constants</a></li><li><a href="#types">Type Definitions</a></li></ul></div><div id="sidebar-vars" data-name="layout" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">layout</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#1-418" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DirEntry.html" title="os::fs::easy_fs::layout::DirEntry struct">DirEntry</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.DiskInode.html" title="os::fs::easy_fs::layout::DiskInode struct">DiskInode</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.SuperBlock.html" title="os::fs::easy_fs::layout::SuperBlock struct">SuperBlock</a></div><div class="item-right docblock-short"></div></div></div><h2 id="enums" class="small-section-header"><a href="#enums">Enums</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="enum" href="enum.DiskInodeType.html" title="os::fs::easy_fs::layout::DiskInodeType enum">DiskInodeType</a></div><div class="item-right docblock-short"></div></div></div><h2 id="constants" class="small-section-header"><a href="#constants">Constants</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.DIRECT_BOUND.html" title="os::fs::easy_fs::layout::DIRECT_BOUND constant">DIRECT_BOUND</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.DIRENT_SZ.html" title="os::fs::easy_fs::layout::DIRENT_SZ constant">DIRENT_SZ</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.EFS_MAGIC.html" title="os::fs::easy_fs::layout::EFS_MAGIC constant">EFS_MAGIC</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.INDIRECT1_BOUND.html" title="os::fs::easy_fs::layout::INDIRECT1_BOUND constant">INDIRECT1_BOUND</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.INDIRECT2_BOUND.html" title="os::fs::easy_fs::layout::INDIRECT2_BOUND constant">INDIRECT2_BOUND</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.INODE_DIRECT_COUNT.html" title="os::fs::easy_fs::layout::INODE_DIRECT_COUNT constant">INODE_DIRECT_COUNT</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.INODE_INDIRECT1_COUNT.html" title="os::fs::easy_fs::layout::INODE_INDIRECT1_COUNT constant">INODE_INDIRECT1_COUNT</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.INODE_INDIRECT2_COUNT.html" title="os::fs::easy_fs::layout::INODE_INDIRECT2_COUNT constant">INODE_INDIRECT2_COUNT</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="constant" href="constant.NAME_LENGTH_LIMIT.html" title="os::fs::easy_fs::layout::NAME_LENGTH_LIMIT constant">NAME_LENGTH_LIMIT</a></div><div class="item-right docblock-short"></div></div></div><h2 id="types" class="small-section-header"><a href="#types">Type Definitions</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="type" href="type.DataBlock.html" title="os::fs::easy_fs::layout::DataBlock type">DataBlock</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="type" href="type.IndirectBlock.html" title="os::fs::easy_fs::layout::IndirectBlock type">IndirectBlock</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/layout/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/layout/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"constant":[["DIRECT_BOUND",""],["DIRENT_SZ",""],["EFS_MAGIC",""],["INDIRECT1_BOUND",""],["INDIRECT2_BOUND",""],["INODE_DIRECT_COUNT",""],["INODE_INDIRECT1_COUNT",""],["INODE_INDIRECT2_COUNT",""],["NAME_LENGTH_LIMIT",""]],"enum":[["DiskInodeType",""]],"struct":[["DirEntry",""],["DiskInode",""],["SuperBlock",""]],"type":[["DataBlock",""],["IndirectBlock",""]]});
|
18
ch9-log/os/fs/easy_fs/layout/struct.DirEntry.html
Normal file
18
ch9-log/os/fs/easy_fs/layout/struct.DirEntry.html
Normal file
File diff suppressed because one or more lines are too long
27
ch9-log/os/fs/easy_fs/layout/struct.DiskInode.html
Normal file
27
ch9-log/os/fs/easy_fs/layout/struct.DiskInode.html
Normal file
@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DiskInode` struct in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DiskInode"><title>DiskInode in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Struct DiskInode</a></h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#fields">Fields</a></h3><div class="sidebar-links"><a href="#structfield.direct">direct</a><a href="#structfield.indirect1">indirect1</a><a href="#structfield.indirect2">indirect2</a><a href="#structfield.size">size</a><a href="#structfield.type_">type_</a></div><h3 class="sidebar-title"><a href="#implementations">Methods</a></h3><div class="sidebar-links"><a href="#method._data_blocks">_data_blocks</a><a href="#method.blocks_num_needed">blocks_num_needed</a><a href="#method.clear_size">clear_size</a><a href="#method.data_blocks">data_blocks</a><a href="#method.get_block_id">get_block_id</a><a href="#method.increase_size">increase_size</a><a href="#method.initialize">initialize</a><a href="#method.is_dir">is_dir</a><a href="#method.is_file">is_file</a><a href="#method.read_at">read_at</a><a href="#method.total_blocks">total_blocks</a><a href="#method.write_at">write_at</a></div><h3 class="sidebar-title"><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><div class="sidebar-links"><a href="#impl-RefUnwindSafe">RefUnwindSafe</a><a href="#impl-Send">Send</a><a href="#impl-Sync">Sync</a><a href="#impl-Unpin">Unpin</a><a href="#impl-UnwindSafe">UnwindSafe</a></div><h3 class="sidebar-title"><a href="#blanket-implementations">Blanket Implementations</a></h3><div class="sidebar-links"><a href="#impl-Any">Any</a><a href="#impl-Borrow%3CT%3E">Borrow<T></a><a href="#impl-BorrowMut%3CT%3E">BorrowMut<T></a><a href="#impl-From%3CT%3E">From<T></a><a href="#impl-Into%3CU%3E">Into<U></a><a href="#impl-TryFrom%3CU%3E">TryFrom<U></a><a href="#impl-TryInto%3CU%3E">TryInto<U></a></div></div><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="DiskInode" data-ty="struct" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="struct" href="#">DiskInode</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#72-78" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code><div class="code-attribute">#[repr(C)]</div>pub struct DiskInode {
|
||||
pub size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>,
|
||||
pub direct: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 28]</a>,
|
||||
pub indirect1: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>,
|
||||
pub indirect2: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>,
|
||||
type_: <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.size" class="structfield small-section-header"><a href="#structfield.size" class="anchor field"></a><code>size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></code></span><span id="structfield.direct" class="structfield small-section-header"><a href="#structfield.direct" class="anchor field"></a><code>direct: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 28]</a></code></span><span id="structfield.indirect1" class="structfield small-section-header"><a href="#structfield.indirect1" class="anchor field"></a><code>indirect1: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></code></span><span id="structfield.indirect2" class="structfield small-section-header"><a href="#structfield.indirect2" class="anchor field"></a><code>indirect2: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></code></span><span id="structfield.type_" class="structfield small-section-header"><a href="#structfield.type_" class="anchor field"></a><code>type_: <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a></code></span><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#80-379" title="goto source code">source</a></div><a href="#impl" class="anchor"></a><h3 class="code-header in-band">impl <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.initialize" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#82-89" title="goto source code">source</a></div><a href="#method.initialize" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.initialize" class="fnname">initialize</a>(&mut self, type_: <a class="enum" href="enum.DiskInodeType.html" title="enum os::fs::easy_fs::layout::DiskInodeType">DiskInodeType</a>)</h4></div></summary><div class="docblock"><p>indirect1 and indirect2 block are allocated only when they are needed.</p>
|
||||
</div></details><div id="method.is_dir" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#90-92" title="goto source code">source</a></div><a href="#method.is_dir" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_dir" class="fnname">is_dir</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div><div id="method.is_file" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#94-96" title="goto source code">source</a></div><a href="#method.is_file" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.is_file" class="fnname">is_file</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.bool.html">bool</a></h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.data_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#98-100" title="goto source code">source</a></div><a href="#method.data_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.data_blocks" class="fnname">data_blocks</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Return block number correspond to size.</p>
|
||||
</div></details><div id="method._data_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#101-103" title="goto source code">source</a></div><a href="#method._data_blocks" class="anchor"></a><h4 class="code-header">fn <a href="#method._data_blocks" class="fnname">_data_blocks</a>(size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.total_blocks" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#105-120" title="goto source code">source</a></div><a href="#method.total_blocks" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.total_blocks" class="fnname">total_blocks</a>(size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Return number of blocks needed include indirect1/2.</p>
|
||||
</div></details><div id="method.blocks_num_needed" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#121-124" title="goto source code">source</a></div><a href="#method.blocks_num_needed" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.blocks_num_needed" class="fnname">blocks_num_needed</a>(&self, new_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></div><div id="method.get_block_id" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#125-149" title="goto source code">source</a></div><a href="#method.get_block_id" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.get_block_id" class="fnname">get_block_id</a>(<br> &self, <br> inner_id: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>, <br> block_device: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a></h4></div><div id="method.increase_size" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#150-222" title="goto source code">source</a></div><a href="#method.increase_size" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.increase_size" class="fnname">increase_size</a>(<br> &mut self, <br> new_size: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>, <br> new_blocks: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>>, <br> block_device: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>><br>)</h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.clear_size" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#227-299" title="goto source code">source</a></div><a href="#method.clear_size" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.clear_size" class="fnname">clear_size</a>(&mut self, block_device: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>>) -> <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/vec/struct.Vec.html" title="struct alloc::vec::Vec">Vec</a><<a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a>></h4></div></summary><div class="docblock"><p>Clear size to zero and return blocks that should be deallocated.</p>
|
||||
<p>We will clear the block contents to zero later.</p>
|
||||
</div></details><div id="method.read_at" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#300-339" title="goto source code">source</a></div><a href="#method.read_at" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.read_at" class="fnname">read_at</a>(<br> &self, <br> offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <br> buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&mut [</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>, <br> block_device: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></div><details class="rustdoc-toggle method-toggle" open><summary><div id="method.write_at" class="method has-srclink"><div class="rightside"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#341-378" title="goto source code">source</a></div><a href="#method.write_at" class="anchor"></a><h4 class="code-header">pub fn <a href="#method.write_at" class="fnname">write_at</a>(<br> &mut self, <br> offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>, <br> buf: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">&[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.slice.html">]</a>, <br> block_device: &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><dyn <a class="trait" href="../block_dev/trait.BlockDevice.html" title="trait os::fs::easy_fs::block_dev::BlockDevice">BlockDevice</a>><br>) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></h4></div></summary><div class="docblock"><p>File size must be adjusted before.</p>
|
||||
</div></details></div></details><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.DiskInode.html" title="struct os::fs::easy_fs::layout::DiskInode">DiskInode</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549-553" title="goto source code">source</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#550" title="goto source code">source</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Into%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#537-544" title="goto source code">source</a></div><a href="#impl-Into%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#541" title="goto source code">source</a></div><a href="#method.into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html#tymethod.into" class="fnname">into</a>(self) -> U</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryFrom%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#589-598" title="goto source code">source</a></div><a href="#impl-TryFrom%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.Into.html" title="trait core::convert::Into">Into</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error-1" class="type trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" class="associatedtype">Error</a> = <a class="enum" href="https://doc.rust-lang.org/nightly/core/convert/enum.Infallible.html" title="enum core::convert::Infallible">Infallible</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#595" title="goto source code">source</a></div><a href="#method.try_from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#tymethod.try_from" class="fnname">try_from</a>(value: U) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><T, <T as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><U>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-TryInto%3CU%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#574-583" title="goto source code">source</a></div><a href="#impl-TryInto%3CU%3E" class="anchor"></a><h3 class="code-header in-band">impl<T, U> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html" title="trait core::convert::TryInto">TryInto</a><U> for T <span class="where fmt-newline">where<br> U: <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Error" class="type trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#associatedtype.Error" class="associatedtype">Error</a> = <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a></h4></div></summary><div class='docblock'><p>The type returned in the event of a conversion error.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.try_into" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#580" title="goto source code">source</a></div><a href="#method.try_into" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.TryInto.html#tymethod.try_into" class="fnname">try_into</a>(self) -> <a class="enum" href="https://doc.rust-lang.org/nightly/core/result/enum.Result.html" title="enum core::result::Result">Result</a><U, <U as <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html" title="trait core::convert::TryFrom">TryFrom</a><T>>::<a class="associatedtype" href="https://doc.rust-lang.org/nightly/core/convert/trait.TryFrom.html#associatedtype.Error" title="type core::convert::TryFrom::Error">Error</a>></h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
</div></details></div></details></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
23
ch9-log/os/fs/easy_fs/layout/struct.SuperBlock.html
Normal file
23
ch9-log/os/fs/easy_fs/layout/struct.SuperBlock.html
Normal file
File diff suppressed because one or more lines are too long
6
ch9-log/os/fs/easy_fs/layout/type.DataBlock.html
Normal file
6
ch9-log/os/fs/easy_fs/layout/type.DataBlock.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `DataBlock` type in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, DataBlock"><title>DataBlock in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Type Definition DataBlock</a></h2><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="DataBlock" data-ty="type" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Type Definition <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="type" href="#">DataBlock</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#69" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust typedef"><code>type DataBlock = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 512]</a>;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
6
ch9-log/os/fs/easy_fs/layout/type.IndirectBlock.html
Normal file
6
ch9-log/os/fs/easy_fs/layout/type.IndirectBlock.html
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `IndirectBlock` type in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, IndirectBlock"><title>IndirectBlock in os::fs::easy_fs::layout - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc type"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Type Definition IndirectBlock</a></h2><div class="sidebar-elems"><h2 class="location">Other items in<br><a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a></h2><div id="sidebar-vars" data-name="IndirectBlock" data-ty="type" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Type Definition <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a href="index.html">layout</a>::<wbr><a class="type" href="#">IndirectBlock</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/layout.rs.html#68" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust typedef"><code>type IndirectBlock = <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.array.html">; 128]</a>;</code></pre></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"constant":[["BLOCK_SZ",""]],"mod":[["bitmap",""],["block_cache",""],["block_dev",""],["efs",""],["layout",""],["vfs",""]]});
|
7
ch9-log/os/fs/easy_fs/vfs/index.html
Normal file
7
ch9-log/os/fs/easy_fs/vfs/index.html
Normal file
@ -0,0 +1,7 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `vfs` mod in crate `os`."><meta name="keywords" content="rust, rustlang, rust-lang, vfs"><title>os::fs::easy_fs::vfs - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module vfs</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><div id="sidebar-vars" data-name="vfs" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../../../index.html">os</a>::<wbr><a href="../../index.html">fs</a>::<wbr><a href="../index.html">easy_fs</a>::<wbr><a class="mod" href="#">vfs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/os/fs/easy_fs/vfs.rs.html#1-198" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Inode.html" title="os::fs::easy_fs::vfs::Inode struct">Inode</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
1
ch9-log/os/fs/easy_fs/vfs/sidebar-items.js
Normal file
1
ch9-log/os/fs/easy_fs/vfs/sidebar-items.js
Normal file
@ -0,0 +1 @@
|
||||
initSidebarItems({"struct":[["Inode",""]]});
|
21
ch9-log/os/fs/easy_fs/vfs/struct.Inode.html
Normal file
21
ch9-log/os/fs/easy_fs/vfs/struct.Inode.html
Normal file
File diff suppressed because one or more lines are too long
@ -2,8 +2,8 @@
|
||||
<noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div>
|
||||
</a><h2 class="location"><a href="#">Module fs</a></h2><div class="sidebar-elems"><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#traits">Traits</a></li></ul></div><div id="sidebar-vars" data-name="fs" data-ty="mod" data-relpath="./"></div><script defer src="./sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../os/index.html"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">fs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/fs/mod.rs.html#1-16" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="fn" href="inode/fn.list_apps.html" title="fn os::fs::inode::list_apps">list_apps</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="fn" href="inode/fn.open_file.html" title="fn os::fs::inode::open_file">open_file</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="struct" href="inode/struct.OSInode.html" title="struct os::fs::inode::OSInode">OSInode</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="struct" href="inode/struct.OpenFlags.html" title="struct os::fs::inode::OpenFlags">OpenFlags</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use pipe::<a class="fn" href="pipe/fn.make_pipe.html" title="fn os::fs::pipe::make_pipe">make_pipe</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use pipe::<a class="struct" href="pipe/struct.Pipe.html" title="struct os::fs::pipe::Pipe">Pipe</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use stdio::<a class="struct" href="stdio/struct.Stdin.html" title="struct os::fs::stdio::Stdin">Stdin</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use stdio::<a class="struct" href="stdio/struct.Stdout.html" title="struct os::fs::stdio::Stdout">Stdout</a>;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="inode/index.html" title="os::fs::inode mod">inode</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="pipe/index.html" title="os::fs::pipe mod">pipe</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="stdio/index.html" title="os::fs::stdio mod">stdio</a></div><div class="item-right docblock-short"></div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<h1 class="fqn"><span class="in-band">Module <a href="../index.html">os</a>::<wbr><a class="mod" href="#">fs</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../src/os/fs/mod.rs.html#1-17" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><h2 id="reexports" class="small-section-header"><a href="#reexports">Re-exports</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="fn" href="inode/fn.list_apps.html" title="fn os::fs::inode::list_apps">list_apps</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="fn" href="inode/fn.open_file.html" title="fn os::fs::inode::open_file">open_file</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="struct" href="inode/struct.OSInode.html" title="struct os::fs::inode::OSInode">OSInode</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use inode::<a class="struct" href="inode/struct.OpenFlags.html" title="struct os::fs::inode::OpenFlags">OpenFlags</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use pipe::<a class="fn" href="pipe/fn.make_pipe.html" title="fn os::fs::pipe::make_pipe">make_pipe</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use pipe::<a class="struct" href="pipe/struct.Pipe.html" title="struct os::fs::pipe::Pipe">Pipe</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use stdio::<a class="struct" href="stdio/struct.Stdin.html" title="struct os::fs::stdio::Stdin">Stdin</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use stdio::<a class="struct" href="stdio/struct.Stdout.html" title="struct os::fs::stdio::Stdout">Stdout</a>;</code></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left import-item"><code>pub use <a class="mod" href="easy_fs/index.html" title="mod os::fs::easy_fs">easy_fs</a>::*;</code></div><div class="item-right docblock-short"></div></div></div><h2 id="modules" class="small-section-header"><a href="#modules">Modules</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="mod" href="easy_fs/index.html" title="os::fs::easy_fs mod">easy_fs</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="inode/index.html" title="os::fs::inode mod">inode</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="pipe/index.html" title="os::fs::pipe mod">pipe</a></div><div class="item-right docblock-short"></div></div><div class="item-row"><div class="item-left module-item"><a class="mod" href="stdio/index.html" title="os::fs::stdio mod">stdio</a></div><div class="item-right docblock-short"></div></div></div><h2 id="traits" class="small-section-header"><a href="#traits">Traits</a></h2>
|
||||
<div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="trait" href="trait.File.html" title="os::fs::File trait">File</a></div><div class="item-right docblock-short"></div></div></div></section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
File diff suppressed because one or more lines are too long
@ -4,8 +4,8 @@
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../../index.html">os</a>::<wbr><a href="../index.html">fs</a>::<wbr><a href="index.html">inode</a>::<wbr><a class="struct" href="#">OSInodeInner</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/fs/inode.rs.html#17-20" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct OSInodeInner {
|
||||
offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a>,
|
||||
inode: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Inode>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.offset" class="structfield small-section-header"><a href="#structfield.offset" class="anchor field"></a><code>offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></code></span><span id="structfield.inode" class="structfield small-section-header"><a href="#structfield.inode" class="anchor field"></a><code>inode: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Inode></code></span><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
inode: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../easy_fs/vfs/struct.Inode.html" title="struct os::fs::easy_fs::vfs::Inode">Inode</a>>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.offset" class="structfield small-section-header"><a href="#structfield.offset" class="anchor field"></a><code>offset: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.usize.html">usize</a></code></span><span id="structfield.inode" class="structfield small-section-header"><a href="#structfield.inode" class="anchor field"></a><code>inode: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../easy_fs/vfs/struct.Inode.html" title="struct os::fs::easy_fs::vfs::Inode">Inode</a>></code></span><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl !<a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.OSInodeInner.html" title="struct os::fs::inode::OSInodeInner">OSInodeInner</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-From%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#549-553" title="goto source code">source</a></div><a href="#impl-From%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html" title="trait core::convert::From">From</a><T> for T</h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.from" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/convert/mod.rs.html#550" title="goto source code">source</a></div><a href="#method.from" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/convert/trait.From.html#tymethod.from" class="fnname">from</a>(t: T) -> T</h4></div></summary><div class='docblock'><p>Performs the conversion.</p>
|
||||
|
@ -4,8 +4,8 @@
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="main-heading">
|
||||
<h1 class="fqn"><span class="in-band">Struct <a href="../../index.html">os</a>::<wbr><a href="../index.html">fs</a>::<wbr><a href="index.html">inode</a>::<wbr><a class="struct" href="#">ROOT_INODE</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span></div><div class="docblock item-decl"><pre class="rust struct"><code>pub struct ROOT_INODE {
|
||||
__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a>,
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.__private_field" class="structfield small-section-header"><a href="#structfield.__private_field" class="anchor field"></a><code>__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a></code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Deref" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a></div><a href="#impl-Deref" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Inode></h4></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a></div><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><Inode></h4></div></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
}</code></pre></div><h2 id="fields" class="fields small-section-header">Fields<a href="#fields" class="anchor"></a></h2><span id="structfield.__private_field" class="structfield small-section-header"><a href="#structfield.__private_field" class="anchor field"></a><code>__private_field: <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.unit.html">()</a></code></span><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Deref" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a></div><a href="#impl-Deref" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html" title="trait core::ops::deref::Deref">Deref</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><div id="associatedtype.Target" class="type trait-impl has-srclink"><a href="#associatedtype.Target" class="anchor"></a><h4 class="code-header">type <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#associatedtype.Target" class="associatedtype">Target</a> = <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../easy_fs/vfs/struct.Inode.html" title="struct os::fs::easy_fs::vfs::Inode">Inode</a>></h4></div></summary><div class='docblock'><p>The resulting type after dereferencing.</p>
|
||||
</div></details><details class="rustdoc-toggle method-toggle" open><summary><div id="method.deref" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a></div><a href="#method.deref" class="anchor"></a><h4 class="code-header">fn <a href="https://doc.rust-lang.org/nightly/core/ops/deref/trait.Deref.html#tymethod.deref" class="fnname">deref</a>(&self) -> &<a class="struct" href="https://doc.rust-lang.org/nightly/alloc/sync/struct.Arc.html" title="struct alloc::sync::Arc">Arc</a><<a class="struct" href="../easy_fs/vfs/struct.Inode.html" title="struct os::fs::easy_fs::vfs::Inode">Inode</a>></h4></div></summary><div class='docblock'><p>Dereferences the value.</p>
|
||||
</div></details></div></details><div id="impl-LazyStatic" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../../../src/os/fs/inode.rs.html#46-51" title="goto source code">source</a></div><a href="#impl-LazyStatic" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://docs.rs/lazy_static/1.4.0/lazy_static/trait.LazyStatic.html" title="trait lazy_static::LazyStatic">LazyStatic</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><div id="impl-RefUnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-RefUnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.RefUnwindSafe.html" title="trait core::panic::unwind_safe::RefUnwindSafe">RefUnwindSafe</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div><div id="impl-Send" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Send" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Send.html" title="trait core::marker::Send">Send</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div><div id="impl-Sync" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Sync" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sync.html" title="trait core::marker::Sync">Sync</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div><div id="impl-Unpin" class="impl has-srclink"><div class="rightside"></div><a href="#impl-Unpin" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Unpin.html" title="trait core::marker::Unpin">Unpin</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div><div id="impl-UnwindSafe" class="impl has-srclink"><div class="rightside"></div><a href="#impl-UnwindSafe" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/panic/unwind_safe/trait.UnwindSafe.html" title="trait core::panic::unwind_safe::UnwindSafe">UnwindSafe</a> for <a class="struct" href="struct.ROOT_INODE.html" title="struct os::fs::inode::ROOT_INODE">ROOT_INODE</a></h3></div></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Any" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#132-136" title="goto source code">source</a></div><a href="#impl-Any" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html" title="trait core::any::Any">Any</a> for T <span class="where fmt-newline">where<br> T: 'static + ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.type_id" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/any.rs.html#133" title="goto source code">source</a></div><a href="#method.type_id" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id" class="fnname">type_id</a>(&self) -> <a class="struct" href="https://doc.rust-lang.org/nightly/core/any/struct.TypeId.html" title="struct core::any::TypeId">TypeId</a></h4></div></summary><div class='docblock'><p>Gets the <code>TypeId</code> of <code>self</code>. <a href="https://doc.rust-lang.org/nightly/core/any/trait.Any.html#tymethod.type_id">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-Borrow%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#209-214" title="goto source code">source</a></div><a href="#impl-Borrow%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html" title="trait core::borrow::Borrow">Borrow</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#211" title="goto source code">source</a></div><a href="#method.borrow" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow" class="fnname">borrow</a>(&self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&</a>T</h4></div></summary><div class='docblock'><p>Immutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.Borrow.html#tymethod.borrow">Read more</a></p>
|
||||
</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><div id="impl-BorrowMut%3CT%3E" class="impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#218-222" title="goto source code">source</a></div><a href="#impl-BorrowMut%3CT%3E" class="anchor"></a><h3 class="code-header in-band">impl<T> <a class="trait" href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html" title="trait core::borrow::BorrowMut">BorrowMut</a><T> for T <span class="where fmt-newline">where<br> T: ?<a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a>, </span></h3></div></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><div id="method.borrow_mut" class="method trait-impl has-srclink"><div class="rightside"><a class="srclink" href="https://doc.rust-lang.org/nightly/src/core/borrow.rs.html#219" title="goto source code">source</a></div><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">pub fn <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut" class="fnname">borrow_mut</a>(&mut self) -> <a class="primitive" href="https://doc.rust-lang.org/nightly/core/primitive.reference.html">&mut </a>T</h4></div></summary><div class='docblock'><p>Mutably borrows from an owned value. <a href="https://doc.rust-lang.org/nightly/core/borrow/trait.BorrowMut.html#tymethod.borrow_mut">Read more</a></p>
|
||||
|
@ -1 +1 @@
|
||||
initSidebarItems({"mod":[["inode",""],["pipe",""],["stdio",""]],"trait":[["File",""]]});
|
||||
initSidebarItems({"mod":[["easy_fs",""],["inode",""],["pipe",""],["stdio",""]],"trait":[["File",""]]});
|
File diff suppressed because one or more lines are too long
@ -1,3 +1,3 @@
|
||||
var N = null;var sourcesIndex = {};
|
||||
sourcesIndex["os"] = {"name":"","dirs":[{"name":"board","files":["mod.rs"]},{"name":"drivers","dirs":[{"name":"block","files":["mod.rs","virtio_blk.rs"]},{"name":"chardev","files":["mod.rs","ns16550a.rs"]}],"files":["mod.rs","plic.rs"]},{"name":"fs","files":["inode.rs","mod.rs","pipe.rs","stdio.rs"]},{"name":"mm","files":["address.rs","frame_allocator.rs","heap_allocator.rs","memory_set.rs","mod.rs","page_table.rs"]},{"name":"sync","files":["condvar.rs","mod.rs","mutex.rs","semaphore.rs","up.rs"]},{"name":"syscall","files":["fs.rs","mod.rs","process.rs","sync.rs","thread.rs"]},{"name":"task","files":["context.rs","id.rs","manager.rs","mod.rs","process.rs","processor.rs","signal.rs","switch.rs","task.rs"]},{"name":"trap","files":["context.rs","mod.rs"]}],"files":["config.rs","console.rs","lang_items.rs","main.rs","sbi.rs","timer.rs"]};
|
||||
sourcesIndex["os"] = {"name":"","dirs":[{"name":"board","files":["mod.rs"]},{"name":"drivers","dirs":[{"name":"block","files":["mod.rs","virtio_blk.rs"]},{"name":"chardev","files":["mod.rs","ns16550a.rs"]}],"files":["mod.rs","plic.rs"]},{"name":"fs","dirs":[{"name":"easy_fs","files":["bitmap.rs","block_cache.rs","block_dev.rs","efs.rs","layout.rs","mod.rs","vfs.rs"]}],"files":["inode.rs","mod.rs","pipe.rs","stdio.rs"]},{"name":"mm","files":["address.rs","frame_allocator.rs","heap_allocator.rs","memory_set.rs","mod.rs","page_table.rs"]},{"name":"sync","files":["condvar.rs","mod.rs","mutex.rs","semaphore.rs","up.rs"]},{"name":"syscall","files":["fs.rs","mod.rs","process.rs","sync.rs","thread.rs"]},{"name":"task","files":["context.rs","id.rs","manager.rs","mod.rs","process.rs","processor.rs","signal.rs","switch.rs","task.rs"]},{"name":"trap","files":["context.rs","mod.rs"]}],"files":["config.rs","console.rs","lang_items.rs","main.rs","sbi.rs","timer.rs"]};
|
||||
createSourceSidebar();
|
||||
|
@ -39,7 +39,7 @@
|
||||
|
||||
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::board::BlockDeviceImpl</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">easy_fs::BlockDevice</span>;
|
||||
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::fs::easy_fs::BlockDevice</span>;
|
||||
<span class="kw">use</span> <span class="ident">lazy_static</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="macro">lazy_static!</span> {
|
||||
|
150
ch9-log/src/os/fs/easy_fs/bitmap.rs.html
Normal file
150
ch9-log/src/os/fs/easy_fs/bitmap.rs.html
Normal file
@ -0,0 +1,150 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/bitmap.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>bitmap.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10">10</span>
|
||||
<span id="11">11</span>
|
||||
<span id="12">12</span>
|
||||
<span id="13">13</span>
|
||||
<span id="14">14</span>
|
||||
<span id="15">15</span>
|
||||
<span id="16">16</span>
|
||||
<span id="17">17</span>
|
||||
<span id="18">18</span>
|
||||
<span id="19">19</span>
|
||||
<span id="20">20</span>
|
||||
<span id="21">21</span>
|
||||
<span id="22">22</span>
|
||||
<span id="23">23</span>
|
||||
<span id="24">24</span>
|
||||
<span id="25">25</span>
|
||||
<span id="26">26</span>
|
||||
<span id="27">27</span>
|
||||
<span id="28">28</span>
|
||||
<span id="29">29</span>
|
||||
<span id="30">30</span>
|
||||
<span id="31">31</span>
|
||||
<span id="32">32</span>
|
||||
<span id="33">33</span>
|
||||
<span id="34">34</span>
|
||||
<span id="35">35</span>
|
||||
<span id="36">36</span>
|
||||
<span id="37">37</span>
|
||||
<span id="38">38</span>
|
||||
<span id="39">39</span>
|
||||
<span id="40">40</span>
|
||||
<span id="41">41</span>
|
||||
<span id="42">42</span>
|
||||
<span id="43">43</span>
|
||||
<span id="44">44</span>
|
||||
<span id="45">45</span>
|
||||
<span id="46">46</span>
|
||||
<span id="47">47</span>
|
||||
<span id="48">48</span>
|
||||
<span id="49">49</span>
|
||||
<span id="50">50</span>
|
||||
<span id="51">51</span>
|
||||
<span id="52">52</span>
|
||||
<span id="53">53</span>
|
||||
<span id="54">54</span>
|
||||
<span id="55">55</span>
|
||||
<span id="56">56</span>
|
||||
<span id="57">57</span>
|
||||
<span id="58">58</span>
|
||||
<span id="59">59</span>
|
||||
<span id="60">60</span>
|
||||
<span id="61">61</span>
|
||||
<span id="62">62</span>
|
||||
<span id="63">63</span>
|
||||
<span id="64">64</span>
|
||||
<span id="65">65</span>
|
||||
<span id="66">66</span>
|
||||
<span id="67">67</span>
|
||||
<span id="68">68</span>
|
||||
<span id="69">69</span>
|
||||
<span id="70">70</span>
|
||||
<span id="71">71</span>
|
||||
<span id="72">72</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">get_block_cache</span>, <span class="ident">BlockDevice</span>, <span class="ident">BLOCK_SZ</span>};
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
|
||||
<span class="kw">type</span> <span class="ident">BitmapBlock</span> <span class="op">=</span> [<span class="ident">u64</span>; <span class="number">64</span>];
|
||||
|
||||
<span class="kw">const</span> <span class="ident">BLOCK_BITS</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">BLOCK_SZ</span> <span class="op">*</span> <span class="number">8</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Bitmap</span> {
|
||||
<span class="ident">start_block_id</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">blocks</span>: <span class="ident">usize</span>,
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Return (block_pos, bits64_pos, inner_pos)</span>
|
||||
<span class="kw">fn</span> <span class="ident">decomposition</span>(<span class="kw-2">mut</span> <span class="ident">bit</span>: <span class="ident">usize</span>) -> (<span class="ident">usize</span>, <span class="ident">usize</span>, <span class="ident">usize</span>) {
|
||||
<span class="kw">let</span> <span class="ident">block_pos</span> <span class="op">=</span> <span class="ident">bit</span> <span class="op">/</span> <span class="ident">BLOCK_BITS</span>;
|
||||
<span class="ident">bit</span> <span class="op">%</span><span class="op">=</span> <span class="ident">BLOCK_BITS</span>;
|
||||
(<span class="ident">block_pos</span>, <span class="ident">bit</span> <span class="op">/</span> <span class="number">64</span>, <span class="ident">bit</span> <span class="op">%</span> <span class="number">64</span>)
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Bitmap</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">start_block_id</span>: <span class="ident">usize</span>, <span class="ident">blocks</span>: <span class="ident">usize</span>) -> <span class="self">Self</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] bitmap::Bitmap::new() begin"</span>);
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">start_block_id</span>,
|
||||
<span class="ident">blocks</span>,
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">alloc</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">usize</span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] bitmap::Bitmap::alloc() begin"</span>);
|
||||
<span class="kw">for</span> <span class="ident">block_id</span> <span class="kw">in</span> <span class="number">0</span>..<span class="self">self</span>.<span class="ident">blocks</span> {
|
||||
<span class="kw">let</span> <span class="ident">pos</span> <span class="op">=</span> <span class="ident">get_block_cache</span>(
|
||||
<span class="ident">block_id</span> <span class="op">+</span> <span class="self">self</span>.<span class="ident">start_block_id</span> <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">Arc::clone</span>(<span class="ident">block_device</span>),
|
||||
)
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">bitmap_block</span>: <span class="kw-2">&mut</span> <span class="ident">BitmapBlock</span><span class="op">|</span> {
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">bits64_pos</span>, <span class="ident">inner_pos</span>)) <span class="op">=</span> <span class="ident">bitmap_block</span>
|
||||
.<span class="ident">iter</span>()
|
||||
.<span class="ident">enumerate</span>()
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">bits64</span>)<span class="op">|</span> <span class="kw-2">*</span><span class="kw-2">*</span><span class="ident">bits64</span> <span class="op">!</span><span class="op">=</span> <span class="ident">u64::MAX</span>)
|
||||
.<span class="ident">map</span>(<span class="op">|</span>(<span class="ident">bits64_pos</span>, <span class="ident">bits64</span>)<span class="op">|</span> (<span class="ident">bits64_pos</span>, <span class="ident">bits64</span>.<span class="ident">trailing_ones</span>() <span class="kw">as</span> <span class="ident">usize</span>))
|
||||
{
|
||||
<span class="comment">// modify cache</span>
|
||||
<span class="ident">bitmap_block</span>[<span class="ident">bits64_pos</span>] <span class="op">|</span><span class="op">=</span> <span class="number">1u64</span> <span class="op"><</span><span class="op"><</span> <span class="ident">inner_pos</span>;
|
||||
<span class="prelude-val">Some</span>(<span class="ident">block_id</span> <span class="op">*</span> <span class="ident">BLOCK_BITS</span> <span class="op">+</span> <span class="ident">bits64_pos</span> <span class="op">*</span> <span class="number">64</span> <span class="op">+</span> <span class="ident">inner_pos</span> <span class="kw">as</span> <span class="ident">usize</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
});
|
||||
<span class="kw">if</span> <span class="ident">pos</span>.<span class="ident">is_some</span>() {
|
||||
<span class="kw">return</span> <span class="ident">pos</span>;
|
||||
}
|
||||
}
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">dealloc</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>, <span class="ident">bit</span>: <span class="ident">usize</span>) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] bitmap::Bitmap::dealloc() begin"</span>);
|
||||
<span class="kw">let</span> (<span class="ident">block_pos</span>, <span class="ident">bits64_pos</span>, <span class="ident">inner_pos</span>) <span class="op">=</span> <span class="ident">decomposition</span>(<span class="ident">bit</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">block_pos</span> <span class="op">+</span> <span class="self">self</span>.<span class="ident">start_block_id</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">bitmap_block</span>: <span class="kw-2">&mut</span> <span class="ident">BitmapBlock</span><span class="op">|</span> {
|
||||
<span class="macro">assert!</span>(<span class="ident">bitmap_block</span>[<span class="ident">bits64_pos</span>] <span class="op">&</span> (<span class="number">1u64</span> <span class="op"><</span><span class="op"><</span> <span class="ident">inner_pos</span>) <span class="op">></span> <span class="number">0</span>);
|
||||
<span class="ident">bitmap_block</span>[<span class="ident">bits64_pos</span>] <span class="op">-</span><span class="op">=</span> <span class="number">1u64</span> <span class="op"><</span><span class="op"><</span> <span class="ident">inner_pos</span>;
|
||||
});
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">maximum</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">usize</span> {
|
||||
<span class="self">self</span>.<span class="ident">blocks</span> <span class="op">*</span> <span class="ident">BLOCK_BITS</span>
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
294
ch9-log/src/os/fs/easy_fs/block_cache.rs.html
Normal file
294
ch9-log/src/os/fs/easy_fs/block_cache.rs.html
Normal file
@ -0,0 +1,294 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/block_cache.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>block_cache.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10"> 10</span>
|
||||
<span id="11"> 11</span>
|
||||
<span id="12"> 12</span>
|
||||
<span id="13"> 13</span>
|
||||
<span id="14"> 14</span>
|
||||
<span id="15"> 15</span>
|
||||
<span id="16"> 16</span>
|
||||
<span id="17"> 17</span>
|
||||
<span id="18"> 18</span>
|
||||
<span id="19"> 19</span>
|
||||
<span id="20"> 20</span>
|
||||
<span id="21"> 21</span>
|
||||
<span id="22"> 22</span>
|
||||
<span id="23"> 23</span>
|
||||
<span id="24"> 24</span>
|
||||
<span id="25"> 25</span>
|
||||
<span id="26"> 26</span>
|
||||
<span id="27"> 27</span>
|
||||
<span id="28"> 28</span>
|
||||
<span id="29"> 29</span>
|
||||
<span id="30"> 30</span>
|
||||
<span id="31"> 31</span>
|
||||
<span id="32"> 32</span>
|
||||
<span id="33"> 33</span>
|
||||
<span id="34"> 34</span>
|
||||
<span id="35"> 35</span>
|
||||
<span id="36"> 36</span>
|
||||
<span id="37"> 37</span>
|
||||
<span id="38"> 38</span>
|
||||
<span id="39"> 39</span>
|
||||
<span id="40"> 40</span>
|
||||
<span id="41"> 41</span>
|
||||
<span id="42"> 42</span>
|
||||
<span id="43"> 43</span>
|
||||
<span id="44"> 44</span>
|
||||
<span id="45"> 45</span>
|
||||
<span id="46"> 46</span>
|
||||
<span id="47"> 47</span>
|
||||
<span id="48"> 48</span>
|
||||
<span id="49"> 49</span>
|
||||
<span id="50"> 50</span>
|
||||
<span id="51"> 51</span>
|
||||
<span id="52"> 52</span>
|
||||
<span id="53"> 53</span>
|
||||
<span id="54"> 54</span>
|
||||
<span id="55"> 55</span>
|
||||
<span id="56"> 56</span>
|
||||
<span id="57"> 57</span>
|
||||
<span id="58"> 58</span>
|
||||
<span id="59"> 59</span>
|
||||
<span id="60"> 60</span>
|
||||
<span id="61"> 61</span>
|
||||
<span id="62"> 62</span>
|
||||
<span id="63"> 63</span>
|
||||
<span id="64"> 64</span>
|
||||
<span id="65"> 65</span>
|
||||
<span id="66"> 66</span>
|
||||
<span id="67"> 67</span>
|
||||
<span id="68"> 68</span>
|
||||
<span id="69"> 69</span>
|
||||
<span id="70"> 70</span>
|
||||
<span id="71"> 71</span>
|
||||
<span id="72"> 72</span>
|
||||
<span id="73"> 73</span>
|
||||
<span id="74"> 74</span>
|
||||
<span id="75"> 75</span>
|
||||
<span id="76"> 76</span>
|
||||
<span id="77"> 77</span>
|
||||
<span id="78"> 78</span>
|
||||
<span id="79"> 79</span>
|
||||
<span id="80"> 80</span>
|
||||
<span id="81"> 81</span>
|
||||
<span id="82"> 82</span>
|
||||
<span id="83"> 83</span>
|
||||
<span id="84"> 84</span>
|
||||
<span id="85"> 85</span>
|
||||
<span id="86"> 86</span>
|
||||
<span id="87"> 87</span>
|
||||
<span id="88"> 88</span>
|
||||
<span id="89"> 89</span>
|
||||
<span id="90"> 90</span>
|
||||
<span id="91"> 91</span>
|
||||
<span id="92"> 92</span>
|
||||
<span id="93"> 93</span>
|
||||
<span id="94"> 94</span>
|
||||
<span id="95"> 95</span>
|
||||
<span id="96"> 96</span>
|
||||
<span id="97"> 97</span>
|
||||
<span id="98"> 98</span>
|
||||
<span id="99"> 99</span>
|
||||
<span id="100">100</span>
|
||||
<span id="101">101</span>
|
||||
<span id="102">102</span>
|
||||
<span id="103">103</span>
|
||||
<span id="104">104</span>
|
||||
<span id="105">105</span>
|
||||
<span id="106">106</span>
|
||||
<span id="107">107</span>
|
||||
<span id="108">108</span>
|
||||
<span id="109">109</span>
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
<span id="126">126</span>
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
<span id="138">138</span>
|
||||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
<span id="142">142</span>
|
||||
<span id="143">143</span>
|
||||
<span id="144">144</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">BlockDevice</span>, <span class="ident">BLOCK_SZ</span>};
|
||||
<span class="kw">use</span> <span class="ident">alloc::collections::VecDeque</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">lazy_static</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use</span> <span class="ident">spin::Mutex</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BlockCache</span> {
|
||||
<span class="ident">cache</span>: [<span class="ident">u8</span>; <span class="ident">BLOCK_SZ</span>],
|
||||
<span class="ident">block_id</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
<span class="ident">modified</span>: <span class="ident">bool</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">BlockCache</span> {
|
||||
<span class="doccomment">/// Load a new BlockCache from disk.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">block_id</span>: <span class="ident">usize</span>, <span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>) -> <span class="self">Self</span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] block_cache::BlockCache::new() begin");</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">cache</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="ident">BLOCK_SZ</span>];
|
||||
<span class="ident">block_device</span>.<span class="ident">read_block</span>(<span class="ident">block_id</span>, <span class="kw-2">&mut</span> <span class="ident">cache</span>);
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">cache</span>,
|
||||
<span class="ident">block_id</span>,
|
||||
<span class="ident">block_device</span>,
|
||||
<span class="ident">modified</span>: <span class="bool-val">false</span>,
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">addr_of_offset</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>) -> <span class="ident">usize</span> {
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cache</span>[<span class="ident">offset</span>] <span class="kw">as</span> <span class="kw-2">*const</span> <span class="kw">_</span> <span class="kw">as</span> <span class="ident">usize</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_ref</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>) -> <span class="kw-2">&</span><span class="ident">T</span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Sized</span>,
|
||||
{
|
||||
<span class="kw">let</span> <span class="ident">type_size</span> <span class="op">=</span> <span class="ident">core::mem::size_of</span>::<span class="op"><</span><span class="ident">T</span><span class="op">></span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">offset</span> <span class="op">+</span> <span class="ident">type_size</span> <span class="op"><</span><span class="op">=</span> <span class="ident">BLOCK_SZ</span>);
|
||||
<span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">addr_of_offset</span>(<span class="ident">offset</span>);
|
||||
<span class="kw">unsafe</span> { <span class="kw-2">&</span><span class="kw-2">*</span>(<span class="ident">addr</span> <span class="kw">as</span> <span class="kw-2">*const</span> <span class="ident">T</span>) }
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_mut</span><span class="op"><</span><span class="ident">T</span><span class="op">></span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>) -> <span class="kw-2">&mut</span> <span class="ident">T</span>
|
||||
<span class="kw">where</span>
|
||||
<span class="ident">T</span>: <span class="ident">Sized</span>,
|
||||
{
|
||||
<span class="kw">let</span> <span class="ident">type_size</span> <span class="op">=</span> <span class="ident">core::mem::size_of</span>::<span class="op"><</span><span class="ident">T</span><span class="op">></span>();
|
||||
<span class="macro">assert!</span>(<span class="ident">offset</span> <span class="op">+</span> <span class="ident">type_size</span> <span class="op"><</span><span class="op">=</span> <span class="ident">BLOCK_SZ</span>);
|
||||
<span class="self">self</span>.<span class="ident">modified</span> <span class="op">=</span> <span class="bool-val">true</span>;
|
||||
<span class="kw">let</span> <span class="ident">addr</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">addr_of_offset</span>(<span class="ident">offset</span>);
|
||||
<span class="kw">unsafe</span> { <span class="kw-2">&mut</span> <span class="kw-2">*</span>(<span class="ident">addr</span> <span class="kw">as</span> <span class="kw-2">*mut</span> <span class="ident">T</span>) }
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">read</span><span class="op"><</span><span class="ident">T</span>, <span class="ident">V</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>, <span class="ident">f</span>: <span class="kw">impl</span> <span class="ident">FnOnce</span>(<span class="kw-2">&</span><span class="ident">T</span>) -> <span class="ident">V</span>) -> <span class="ident">V</span> {
|
||||
<span class="ident">f</span>(<span class="self">self</span>.<span class="ident">get_ref</span>(<span class="ident">offset</span>))
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">modify</span><span class="op"><</span><span class="ident">T</span>, <span class="ident">V</span><span class="op">></span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>, <span class="ident">f</span>: <span class="kw">impl</span> <span class="ident">FnOnce</span>(<span class="kw-2">&mut</span> <span class="ident">T</span>) -> <span class="ident">V</span>) -> <span class="ident">V</span> {
|
||||
<span class="ident">f</span>(<span class="self">self</span>.<span class="ident">get_mut</span>(<span class="ident">offset</span>))
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">sync</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) {
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">modified</span> {
|
||||
<span class="self">self</span>.<span class="ident">modified</span> <span class="op">=</span> <span class="bool-val">false</span>;
|
||||
<span class="self">self</span>.<span class="ident">block_device</span>.<span class="ident">write_block</span>(<span class="self">self</span>.<span class="ident">block_id</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">cache</span>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Drop</span> <span class="kw">for</span> <span class="ident">BlockCache</span> {
|
||||
<span class="kw">fn</span> <span class="ident">drop</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) {
|
||||
<span class="self">self</span>.<span class="ident">sync</span>()
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">const</span> <span class="ident">BLOCK_CACHE_SIZE</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">16</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">BlockCacheManager</span> {
|
||||
<span class="ident">queue</span>: <span class="ident">VecDeque</span><span class="op"><</span>(<span class="ident">usize</span>, <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">BlockCache</span><span class="op">></span><span class="op">></span>)<span class="op">></span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">BlockCacheManager</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>() -> <span class="self">Self</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] block_cache::BlockCacheManager::new() begin"</span>);
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">queue</span>: <span class="ident">VecDeque::new</span>(),
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_block_cache</span>(
|
||||
<span class="kw-2">&mut</span> <span class="self">self</span>,
|
||||
<span class="ident">block_id</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) -> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">BlockCache</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] block_cache::BlockCacheManager::get_block_cache() begin");</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">pair</span>) <span class="op">=</span> <span class="self">self</span>.<span class="ident">queue</span>.<span class="ident">iter</span>().<span class="ident">find</span>(<span class="op">|</span><span class="ident">pair</span><span class="op">|</span> <span class="ident">pair</span>.<span class="number">0</span> <span class="op">==</span> <span class="ident">block_id</span>) {
|
||||
<span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">pair</span>.<span class="number">1</span>)
|
||||
} <span class="kw">else</span> {
|
||||
<span class="comment">// substitute</span>
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">queue</span>.<span class="ident">len</span>() <span class="op">==</span> <span class="ident">BLOCK_CACHE_SIZE</span> {
|
||||
<span class="comment">// from front to tail</span>
|
||||
<span class="kw">if</span> <span class="kw">let</span> <span class="prelude-val">Some</span>((<span class="ident">idx</span>, <span class="kw">_</span>)) <span class="op">=</span> <span class="self">self</span>
|
||||
.<span class="ident">queue</span>
|
||||
.<span class="ident">iter</span>()
|
||||
.<span class="ident">enumerate</span>()
|
||||
.<span class="ident">find</span>(<span class="op">|</span>(<span class="kw">_</span>, <span class="ident">pair</span>)<span class="op">|</span> <span class="ident">Arc::strong_count</span>(<span class="kw-2">&</span><span class="ident">pair</span>.<span class="number">1</span>) <span class="op">==</span> <span class="number">1</span>)
|
||||
{
|
||||
<span class="self">self</span>.<span class="ident">queue</span>.<span class="ident">drain</span>(<span class="ident">idx</span>..<span class="op">=</span><span class="ident">idx</span>);
|
||||
} <span class="kw">else</span> {
|
||||
<span class="macro">panic!</span>(<span class="string">"Run out of BlockCache!"</span>);
|
||||
}
|
||||
}
|
||||
<span class="comment">// load block into mem and push back</span>
|
||||
<span class="kw">let</span> <span class="ident">block_cache</span> <span class="op">=</span> <span class="ident">Arc::new</span>(<span class="ident">Mutex::new</span>(<span class="ident">BlockCache::new</span>(
|
||||
<span class="ident">block_id</span>,
|
||||
<span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>),
|
||||
)));
|
||||
<span class="self">self</span>.<span class="ident">queue</span>.<span class="ident">push_back</span>((<span class="ident">block_id</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_cache</span>)));
|
||||
<span class="ident">block_cache</span>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
<span class="macro">lazy_static!</span> {
|
||||
<span class="kw">pub</span> <span class="kw">static</span> <span class="kw-2">ref</span> <span class="ident">BLOCK_CACHE_MANAGER</span>: <span class="ident">Mutex</span><span class="op"><</span><span class="ident">BlockCacheManager</span><span class="op">></span> <span class="op">=</span>
|
||||
<span class="ident">Mutex::new</span>(<span class="ident">BlockCacheManager::new</span>());
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_block_cache</span>(
|
||||
<span class="ident">block_id</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) -> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">BlockCache</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] block_cache::get_block_cache() begin");</span>
|
||||
<span class="ident">BLOCK_CACHE_MANAGER</span>
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">get_block_cache</span>(<span class="ident">block_id</span>, <span class="ident">block_device</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">block_cache_sync_all</span>() {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] block_cache::block_cache_sync_all() begin"</span>);
|
||||
<span class="kw">let</span> <span class="ident">manager</span> <span class="op">=</span> <span class="ident">BLOCK_CACHE_MANAGER</span>.<span class="ident">lock</span>();
|
||||
<span class="kw">for</span> (<span class="kw">_</span>, <span class="ident">cache</span>) <span class="kw">in</span> <span class="ident">manager</span>.<span class="ident">queue</span>.<span class="ident">iter</span>() {
|
||||
<span class="ident">cache</span>.<span class="ident">lock</span>().<span class="ident">sync</span>();
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
20
ch9-log/src/os/fs/easy_fs/block_dev.rs.html
Normal file
20
ch9-log/src/os/fs/easy_fs/block_dev.rs.html
Normal file
@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/block_dev.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>block_dev.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1">1</span>
|
||||
<span id="2">2</span>
|
||||
<span id="3">3</span>
|
||||
<span id="4">4</span>
|
||||
<span id="5">5</span>
|
||||
<span id="6">6</span>
|
||||
<span id="7">7</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="ident">core::any::Any</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">BlockDevice</span>: <span class="ident">Send</span> <span class="op">+</span> <span class="ident">Sync</span> <span class="op">+</span> <span class="ident">Any</span> {
|
||||
<span class="kw">fn</span> <span class="ident">read_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_id</span>: <span class="ident">usize</span>, <span class="ident">buf</span>: <span class="kw-2">&mut</span> [<span class="ident">u8</span>]);
|
||||
<span class="kw">fn</span> <span class="ident">write_block</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">block_id</span>: <span class="ident">usize</span>, <span class="ident">buf</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]);
|
||||
<span class="kw">fn</span> <span class="ident">handle_irq</span>(<span class="kw-2">&</span><span class="self">self</span>);
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
322
ch9-log/src/os/fs/easy_fs/efs.rs.html
Normal file
322
ch9-log/src/os/fs/easy_fs/efs.rs.html
Normal file
@ -0,0 +1,322 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/efs.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>efs.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10"> 10</span>
|
||||
<span id="11"> 11</span>
|
||||
<span id="12"> 12</span>
|
||||
<span id="13"> 13</span>
|
||||
<span id="14"> 14</span>
|
||||
<span id="15"> 15</span>
|
||||
<span id="16"> 16</span>
|
||||
<span id="17"> 17</span>
|
||||
<span id="18"> 18</span>
|
||||
<span id="19"> 19</span>
|
||||
<span id="20"> 20</span>
|
||||
<span id="21"> 21</span>
|
||||
<span id="22"> 22</span>
|
||||
<span id="23"> 23</span>
|
||||
<span id="24"> 24</span>
|
||||
<span id="25"> 25</span>
|
||||
<span id="26"> 26</span>
|
||||
<span id="27"> 27</span>
|
||||
<span id="28"> 28</span>
|
||||
<span id="29"> 29</span>
|
||||
<span id="30"> 30</span>
|
||||
<span id="31"> 31</span>
|
||||
<span id="32"> 32</span>
|
||||
<span id="33"> 33</span>
|
||||
<span id="34"> 34</span>
|
||||
<span id="35"> 35</span>
|
||||
<span id="36"> 36</span>
|
||||
<span id="37"> 37</span>
|
||||
<span id="38"> 38</span>
|
||||
<span id="39"> 39</span>
|
||||
<span id="40"> 40</span>
|
||||
<span id="41"> 41</span>
|
||||
<span id="42"> 42</span>
|
||||
<span id="43"> 43</span>
|
||||
<span id="44"> 44</span>
|
||||
<span id="45"> 45</span>
|
||||
<span id="46"> 46</span>
|
||||
<span id="47"> 47</span>
|
||||
<span id="48"> 48</span>
|
||||
<span id="49"> 49</span>
|
||||
<span id="50"> 50</span>
|
||||
<span id="51"> 51</span>
|
||||
<span id="52"> 52</span>
|
||||
<span id="53"> 53</span>
|
||||
<span id="54"> 54</span>
|
||||
<span id="55"> 55</span>
|
||||
<span id="56"> 56</span>
|
||||
<span id="57"> 57</span>
|
||||
<span id="58"> 58</span>
|
||||
<span id="59"> 59</span>
|
||||
<span id="60"> 60</span>
|
||||
<span id="61"> 61</span>
|
||||
<span id="62"> 62</span>
|
||||
<span id="63"> 63</span>
|
||||
<span id="64"> 64</span>
|
||||
<span id="65"> 65</span>
|
||||
<span id="66"> 66</span>
|
||||
<span id="67"> 67</span>
|
||||
<span id="68"> 68</span>
|
||||
<span id="69"> 69</span>
|
||||
<span id="70"> 70</span>
|
||||
<span id="71"> 71</span>
|
||||
<span id="72"> 72</span>
|
||||
<span id="73"> 73</span>
|
||||
<span id="74"> 74</span>
|
||||
<span id="75"> 75</span>
|
||||
<span id="76"> 76</span>
|
||||
<span id="77"> 77</span>
|
||||
<span id="78"> 78</span>
|
||||
<span id="79"> 79</span>
|
||||
<span id="80"> 80</span>
|
||||
<span id="81"> 81</span>
|
||||
<span id="82"> 82</span>
|
||||
<span id="83"> 83</span>
|
||||
<span id="84"> 84</span>
|
||||
<span id="85"> 85</span>
|
||||
<span id="86"> 86</span>
|
||||
<span id="87"> 87</span>
|
||||
<span id="88"> 88</span>
|
||||
<span id="89"> 89</span>
|
||||
<span id="90"> 90</span>
|
||||
<span id="91"> 91</span>
|
||||
<span id="92"> 92</span>
|
||||
<span id="93"> 93</span>
|
||||
<span id="94"> 94</span>
|
||||
<span id="95"> 95</span>
|
||||
<span id="96"> 96</span>
|
||||
<span id="97"> 97</span>
|
||||
<span id="98"> 98</span>
|
||||
<span id="99"> 99</span>
|
||||
<span id="100">100</span>
|
||||
<span id="101">101</span>
|
||||
<span id="102">102</span>
|
||||
<span id="103">103</span>
|
||||
<span id="104">104</span>
|
||||
<span id="105">105</span>
|
||||
<span id="106">106</span>
|
||||
<span id="107">107</span>
|
||||
<span id="108">108</span>
|
||||
<span id="109">109</span>
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
<span id="126">126</span>
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
<span id="138">138</span>
|
||||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
<span id="142">142</span>
|
||||
<span id="143">143</span>
|
||||
<span id="144">144</span>
|
||||
<span id="145">145</span>
|
||||
<span id="146">146</span>
|
||||
<span id="147">147</span>
|
||||
<span id="148">148</span>
|
||||
<span id="149">149</span>
|
||||
<span id="150">150</span>
|
||||
<span id="151">151</span>
|
||||
<span id="152">152</span>
|
||||
<span id="153">153</span>
|
||||
<span id="154">154</span>
|
||||
<span id="155">155</span>
|
||||
<span id="156">156</span>
|
||||
<span id="157">157</span>
|
||||
<span id="158">158</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="kw">super</span>::{
|
||||
<span class="ident">block_cache_sync_all</span>, <span class="ident">get_block_cache</span>, <span class="ident">Bitmap</span>, <span class="ident">BlockDevice</span>, <span class="ident">DiskInode</span>, <span class="ident">DiskInodeType</span>, <span class="ident">Inode</span>,
|
||||
<span class="ident">SuperBlock</span>,
|
||||
};
|
||||
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::BLOCK_SZ</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">spin::Mutex</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">EasyFileSystem</span> {
|
||||
<span class="kw">pub</span> <span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
<span class="kw">pub</span> <span class="ident">inode_bitmap</span>: <span class="ident">Bitmap</span>,
|
||||
<span class="kw">pub</span> <span class="ident">data_bitmap</span>: <span class="ident">Bitmap</span>,
|
||||
<span class="ident">inode_area_start_block</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">data_area_start_block</span>: <span class="ident">u32</span>,
|
||||
}
|
||||
|
||||
<span class="kw">type</span> <span class="ident">DataBlock</span> <span class="op">=</span> [<span class="ident">u8</span>; <span class="ident">BLOCK_SZ</span>];
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">EasyFileSystem</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">create</span>(
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
<span class="ident">total_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">inode_bitmap_blocks</span>: <span class="ident">u32</span>,
|
||||
) -> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="self">Self</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::create() begin"</span>);
|
||||
<span class="comment">// calculate block size of areas & create bitmaps</span>
|
||||
<span class="kw">let</span> <span class="ident">inode_bitmap</span> <span class="op">=</span> <span class="ident">Bitmap::new</span>(<span class="number">1</span>, <span class="ident">inode_bitmap_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>);
|
||||
<span class="kw">let</span> <span class="ident">inode_num</span> <span class="op">=</span> <span class="ident">inode_bitmap</span>.<span class="ident">maximum</span>();
|
||||
<span class="kw">let</span> <span class="ident">inode_area_blocks</span> <span class="op">=</span>
|
||||
((<span class="ident">inode_num</span> <span class="op">*</span> <span class="ident">core::mem::size_of</span>::<span class="op"><</span><span class="ident">DiskInode</span><span class="op">></span>() <span class="op">+</span> <span class="ident">BLOCK_SZ</span> <span class="op">-</span> <span class="number">1</span>) <span class="op">/</span> <span class="ident">BLOCK_SZ</span>) <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
<span class="kw">let</span> <span class="ident">inode_total_blocks</span> <span class="op">=</span> <span class="ident">inode_bitmap_blocks</span> <span class="op">+</span> <span class="ident">inode_area_blocks</span>;
|
||||
<span class="kw">let</span> <span class="ident">data_total_blocks</span> <span class="op">=</span> <span class="ident">total_blocks</span> <span class="op">-</span> <span class="number">1</span> <span class="op">-</span> <span class="ident">inode_total_blocks</span>;
|
||||
<span class="kw">let</span> <span class="ident">data_bitmap_blocks</span> <span class="op">=</span> (<span class="ident">data_total_blocks</span> <span class="op">+</span> <span class="number">4096</span>) <span class="op">/</span> <span class="number">4097</span>;
|
||||
<span class="kw">let</span> <span class="ident">data_area_blocks</span> <span class="op">=</span> <span class="ident">data_total_blocks</span> <span class="op">-</span> <span class="ident">data_bitmap_blocks</span>;
|
||||
<span class="kw">let</span> <span class="ident">data_bitmap</span> <span class="op">=</span> <span class="ident">Bitmap::new</span>(
|
||||
(<span class="number">1</span> <span class="op">+</span> <span class="ident">inode_bitmap_blocks</span> <span class="op">+</span> <span class="ident">inode_area_blocks</span>) <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">data_bitmap_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">efs</span> <span class="op">=</span> <span class="self">Self</span> {
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>),
|
||||
<span class="ident">inode_bitmap</span>,
|
||||
<span class="ident">data_bitmap</span>,
|
||||
<span class="ident">inode_area_start_block</span>: <span class="number">1</span> <span class="op">+</span> <span class="ident">inode_bitmap_blocks</span>,
|
||||
<span class="ident">data_area_start_block</span>: <span class="number">1</span> <span class="op">+</span> <span class="ident">inode_total_blocks</span> <span class="op">+</span> <span class="ident">data_bitmap_blocks</span>,
|
||||
};
|
||||
<span class="comment">// clear all blocks</span>
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">total_blocks</span> {
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">i</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">data_block</span>: <span class="kw-2">&mut</span> <span class="ident">DataBlock</span><span class="op">|</span> {
|
||||
<span class="kw">for</span> <span class="ident">byte</span> <span class="kw">in</span> <span class="ident">data_block</span>.<span class="ident">iter_mut</span>() {
|
||||
<span class="kw-2">*</span><span class="ident">byte</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
}
|
||||
});
|
||||
}
|
||||
<span class="comment">// initialize SuperBlock</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="number">0</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>)).<span class="ident">lock</span>().<span class="ident">modify</span>(
|
||||
<span class="number">0</span>,
|
||||
<span class="op">|</span><span class="ident">super_block</span>: <span class="kw-2">&mut</span> <span class="ident">SuperBlock</span><span class="op">|</span> {
|
||||
<span class="ident">super_block</span>.<span class="ident">initialize</span>(
|
||||
<span class="ident">total_blocks</span>,
|
||||
<span class="ident">inode_bitmap_blocks</span>,
|
||||
<span class="ident">inode_area_blocks</span>,
|
||||
<span class="ident">data_bitmap_blocks</span>,
|
||||
<span class="ident">data_area_blocks</span>,
|
||||
);
|
||||
},
|
||||
);
|
||||
<span class="comment">// write back immediately</span>
|
||||
<span class="comment">// create a inode for root node "/"</span>
|
||||
<span class="macro">assert_eq!</span>(<span class="ident">efs</span>.<span class="ident">alloc_inode</span>(), <span class="number">0</span>);
|
||||
<span class="kw">let</span> (<span class="ident">root_inode_block_id</span>, <span class="ident">root_inode_offset</span>) <span class="op">=</span> <span class="ident">efs</span>.<span class="ident">get_disk_inode_pos</span>(<span class="number">0</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">root_inode_block_id</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="ident">root_inode_offset</span>, <span class="op">|</span><span class="ident">disk_inode</span>: <span class="kw-2">&mut</span> <span class="ident">DiskInode</span><span class="op">|</span> {
|
||||
<span class="ident">disk_inode</span>.<span class="ident">initialize</span>(<span class="ident">DiskInodeType::Directory</span>);
|
||||
});
|
||||
<span class="ident">block_cache_sync_all</span>();
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::create() end"</span>);
|
||||
<span class="ident">Arc::new</span>(<span class="ident">Mutex::new</span>(<span class="ident">efs</span>))
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">open</span>(<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>) -> <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="self">Self</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::open() begin"</span>);
|
||||
<span class="comment">// read SuperBlock</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="number">0</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">super_block</span>: <span class="kw-2">&</span><span class="ident">SuperBlock</span><span class="op">|</span> {
|
||||
<span class="macro">assert!</span>(<span class="ident">super_block</span>.<span class="ident">is_valid</span>(), <span class="string">"Error loading EFS!"</span>);
|
||||
<span class="kw">let</span> <span class="ident">inode_total_blocks</span> <span class="op">=</span>
|
||||
<span class="ident">super_block</span>.<span class="ident">inode_bitmap_blocks</span> <span class="op">+</span> <span class="ident">super_block</span>.<span class="ident">inode_area_blocks</span>;
|
||||
<span class="kw">let</span> <span class="ident">efs</span> <span class="op">=</span> <span class="self">Self</span> {
|
||||
<span class="ident">block_device</span>,
|
||||
<span class="ident">inode_bitmap</span>: <span class="ident">Bitmap::new</span>(<span class="number">1</span>, <span class="ident">super_block</span>.<span class="ident">inode_bitmap_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>),
|
||||
<span class="ident">data_bitmap</span>: <span class="ident">Bitmap::new</span>(
|
||||
(<span class="number">1</span> <span class="op">+</span> <span class="ident">inode_total_blocks</span>) <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">super_block</span>.<span class="ident">data_bitmap_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
),
|
||||
<span class="ident">inode_area_start_block</span>: <span class="number">1</span> <span class="op">+</span> <span class="ident">super_block</span>.<span class="ident">inode_bitmap_blocks</span>,
|
||||
<span class="ident">data_area_start_block</span>: <span class="number">1</span> <span class="op">+</span> <span class="ident">inode_total_blocks</span> <span class="op">+</span> <span class="ident">super_block</span>.<span class="ident">data_bitmap_blocks</span>,
|
||||
};
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::open() end"</span>);
|
||||
<span class="ident">Arc::new</span>(<span class="ident">Mutex::new</span>(<span class="ident">efs</span>))
|
||||
})
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">root_inode</span>(<span class="ident">efs</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="self">Self</span><span class="op">></span><span class="op">></span>) -> <span class="ident">Inode</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::root_inode() begin"</span>);
|
||||
<span class="kw">let</span> <span class="ident">block_device</span> <span class="op">=</span> <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="ident">efs</span>.<span class="ident">lock</span>().<span class="ident">block_device</span>);
|
||||
<span class="comment">// acquire efs lock temporarily</span>
|
||||
<span class="kw">let</span> (<span class="ident">block_id</span>, <span class="ident">block_offset</span>) <span class="op">=</span> <span class="ident">efs</span>.<span class="ident">lock</span>().<span class="ident">get_disk_inode_pos</span>(<span class="number">0</span>);
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::root_inode() end"</span>);
|
||||
<span class="comment">// release efs lock</span>
|
||||
<span class="ident">Inode::new</span>(<span class="ident">block_id</span>, <span class="ident">block_offset</span>, <span class="ident">Arc::clone</span>(<span class="ident">efs</span>), <span class="ident">block_device</span>)
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_disk_inode_pos</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">inode_id</span>: <span class="ident">u32</span>) -> (<span class="ident">u32</span>, <span class="ident">usize</span>) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::get_disk_inode_pos() begin"</span>);
|
||||
<span class="kw">let</span> <span class="ident">inode_size</span> <span class="op">=</span> <span class="ident">core::mem::size_of</span>::<span class="op"><</span><span class="ident">DiskInode</span><span class="op">></span>();
|
||||
<span class="kw">let</span> <span class="ident">inodes_per_block</span> <span class="op">=</span> (<span class="ident">BLOCK_SZ</span> <span class="op">/</span> <span class="ident">inode_size</span>) <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
<span class="kw">let</span> <span class="ident">block_id</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">inode_area_start_block</span> <span class="op">+</span> <span class="ident">inode_id</span> <span class="op">/</span> <span class="ident">inodes_per_block</span>;
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::get_disk_inode_pos() end"</span>);
|
||||
(
|
||||
<span class="ident">block_id</span>,
|
||||
(<span class="ident">inode_id</span> <span class="op">%</span> <span class="ident">inodes_per_block</span>) <span class="kw">as</span> <span class="ident">usize</span> <span class="op">*</span> <span class="ident">inode_size</span>,
|
||||
)
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_data_block_id</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">data_block_id</span>: <span class="ident">u32</span>) -> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">data_area_start_block</span> <span class="op">+</span> <span class="ident">data_block_id</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">alloc_inode</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="ident">u32</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::alloc_inode() begin"</span>);
|
||||
<span class="self">self</span>.<span class="ident">inode_bitmap</span>.<span class="ident">alloc</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">u32</span>
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Return a block ID not ID in the data area.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">alloc_data</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="ident">u32</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::alloc_data() begin"</span>);
|
||||
<span class="self">self</span>.<span class="ident">data_bitmap</span>.<span class="ident">alloc</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>).<span class="ident">unwrap</span>() <span class="kw">as</span> <span class="ident">u32</span> <span class="op">+</span> <span class="self">self</span>.<span class="ident">data_area_start_block</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">dealloc_data</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">block_id</span>: <span class="ident">u32</span>) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] efs::EasyFileSystem::dealloc_data() begin"</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">block_id</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">data_block</span>: <span class="kw-2">&mut</span> <span class="ident">DataBlock</span><span class="op">|</span> {
|
||||
<span class="ident">data_block</span>.<span class="ident">iter_mut</span>().<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">p</span><span class="op">|</span> {
|
||||
<span class="kw-2">*</span><span class="ident">p</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
})
|
||||
});
|
||||
<span class="self">self</span>.<span class="ident">data_bitmap</span>.<span class="ident">dealloc</span>(
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>,
|
||||
(<span class="ident">block_id</span> <span class="op">-</span> <span class="self">self</span>.<span class="ident">data_area_start_block</span>) <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
)
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
842
ch9-log/src/os/fs/easy_fs/layout.rs.html
Normal file
842
ch9-log/src/os/fs/easy_fs/layout.rs.html
Normal file
@ -0,0 +1,842 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/layout.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>layout.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10"> 10</span>
|
||||
<span id="11"> 11</span>
|
||||
<span id="12"> 12</span>
|
||||
<span id="13"> 13</span>
|
||||
<span id="14"> 14</span>
|
||||
<span id="15"> 15</span>
|
||||
<span id="16"> 16</span>
|
||||
<span id="17"> 17</span>
|
||||
<span id="18"> 18</span>
|
||||
<span id="19"> 19</span>
|
||||
<span id="20"> 20</span>
|
||||
<span id="21"> 21</span>
|
||||
<span id="22"> 22</span>
|
||||
<span id="23"> 23</span>
|
||||
<span id="24"> 24</span>
|
||||
<span id="25"> 25</span>
|
||||
<span id="26"> 26</span>
|
||||
<span id="27"> 27</span>
|
||||
<span id="28"> 28</span>
|
||||
<span id="29"> 29</span>
|
||||
<span id="30"> 30</span>
|
||||
<span id="31"> 31</span>
|
||||
<span id="32"> 32</span>
|
||||
<span id="33"> 33</span>
|
||||
<span id="34"> 34</span>
|
||||
<span id="35"> 35</span>
|
||||
<span id="36"> 36</span>
|
||||
<span id="37"> 37</span>
|
||||
<span id="38"> 38</span>
|
||||
<span id="39"> 39</span>
|
||||
<span id="40"> 40</span>
|
||||
<span id="41"> 41</span>
|
||||
<span id="42"> 42</span>
|
||||
<span id="43"> 43</span>
|
||||
<span id="44"> 44</span>
|
||||
<span id="45"> 45</span>
|
||||
<span id="46"> 46</span>
|
||||
<span id="47"> 47</span>
|
||||
<span id="48"> 48</span>
|
||||
<span id="49"> 49</span>
|
||||
<span id="50"> 50</span>
|
||||
<span id="51"> 51</span>
|
||||
<span id="52"> 52</span>
|
||||
<span id="53"> 53</span>
|
||||
<span id="54"> 54</span>
|
||||
<span id="55"> 55</span>
|
||||
<span id="56"> 56</span>
|
||||
<span id="57"> 57</span>
|
||||
<span id="58"> 58</span>
|
||||
<span id="59"> 59</span>
|
||||
<span id="60"> 60</span>
|
||||
<span id="61"> 61</span>
|
||||
<span id="62"> 62</span>
|
||||
<span id="63"> 63</span>
|
||||
<span id="64"> 64</span>
|
||||
<span id="65"> 65</span>
|
||||
<span id="66"> 66</span>
|
||||
<span id="67"> 67</span>
|
||||
<span id="68"> 68</span>
|
||||
<span id="69"> 69</span>
|
||||
<span id="70"> 70</span>
|
||||
<span id="71"> 71</span>
|
||||
<span id="72"> 72</span>
|
||||
<span id="73"> 73</span>
|
||||
<span id="74"> 74</span>
|
||||
<span id="75"> 75</span>
|
||||
<span id="76"> 76</span>
|
||||
<span id="77"> 77</span>
|
||||
<span id="78"> 78</span>
|
||||
<span id="79"> 79</span>
|
||||
<span id="80"> 80</span>
|
||||
<span id="81"> 81</span>
|
||||
<span id="82"> 82</span>
|
||||
<span id="83"> 83</span>
|
||||
<span id="84"> 84</span>
|
||||
<span id="85"> 85</span>
|
||||
<span id="86"> 86</span>
|
||||
<span id="87"> 87</span>
|
||||
<span id="88"> 88</span>
|
||||
<span id="89"> 89</span>
|
||||
<span id="90"> 90</span>
|
||||
<span id="91"> 91</span>
|
||||
<span id="92"> 92</span>
|
||||
<span id="93"> 93</span>
|
||||
<span id="94"> 94</span>
|
||||
<span id="95"> 95</span>
|
||||
<span id="96"> 96</span>
|
||||
<span id="97"> 97</span>
|
||||
<span id="98"> 98</span>
|
||||
<span id="99"> 99</span>
|
||||
<span id="100">100</span>
|
||||
<span id="101">101</span>
|
||||
<span id="102">102</span>
|
||||
<span id="103">103</span>
|
||||
<span id="104">104</span>
|
||||
<span id="105">105</span>
|
||||
<span id="106">106</span>
|
||||
<span id="107">107</span>
|
||||
<span id="108">108</span>
|
||||
<span id="109">109</span>
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
<span id="126">126</span>
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
<span id="138">138</span>
|
||||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
<span id="142">142</span>
|
||||
<span id="143">143</span>
|
||||
<span id="144">144</span>
|
||||
<span id="145">145</span>
|
||||
<span id="146">146</span>
|
||||
<span id="147">147</span>
|
||||
<span id="148">148</span>
|
||||
<span id="149">149</span>
|
||||
<span id="150">150</span>
|
||||
<span id="151">151</span>
|
||||
<span id="152">152</span>
|
||||
<span id="153">153</span>
|
||||
<span id="154">154</span>
|
||||
<span id="155">155</span>
|
||||
<span id="156">156</span>
|
||||
<span id="157">157</span>
|
||||
<span id="158">158</span>
|
||||
<span id="159">159</span>
|
||||
<span id="160">160</span>
|
||||
<span id="161">161</span>
|
||||
<span id="162">162</span>
|
||||
<span id="163">163</span>
|
||||
<span id="164">164</span>
|
||||
<span id="165">165</span>
|
||||
<span id="166">166</span>
|
||||
<span id="167">167</span>
|
||||
<span id="168">168</span>
|
||||
<span id="169">169</span>
|
||||
<span id="170">170</span>
|
||||
<span id="171">171</span>
|
||||
<span id="172">172</span>
|
||||
<span id="173">173</span>
|
||||
<span id="174">174</span>
|
||||
<span id="175">175</span>
|
||||
<span id="176">176</span>
|
||||
<span id="177">177</span>
|
||||
<span id="178">178</span>
|
||||
<span id="179">179</span>
|
||||
<span id="180">180</span>
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
<span id="185">185</span>
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
<span id="191">191</span>
|
||||
<span id="192">192</span>
|
||||
<span id="193">193</span>
|
||||
<span id="194">194</span>
|
||||
<span id="195">195</span>
|
||||
<span id="196">196</span>
|
||||
<span id="197">197</span>
|
||||
<span id="198">198</span>
|
||||
<span id="199">199</span>
|
||||
<span id="200">200</span>
|
||||
<span id="201">201</span>
|
||||
<span id="202">202</span>
|
||||
<span id="203">203</span>
|
||||
<span id="204">204</span>
|
||||
<span id="205">205</span>
|
||||
<span id="206">206</span>
|
||||
<span id="207">207</span>
|
||||
<span id="208">208</span>
|
||||
<span id="209">209</span>
|
||||
<span id="210">210</span>
|
||||
<span id="211">211</span>
|
||||
<span id="212">212</span>
|
||||
<span id="213">213</span>
|
||||
<span id="214">214</span>
|
||||
<span id="215">215</span>
|
||||
<span id="216">216</span>
|
||||
<span id="217">217</span>
|
||||
<span id="218">218</span>
|
||||
<span id="219">219</span>
|
||||
<span id="220">220</span>
|
||||
<span id="221">221</span>
|
||||
<span id="222">222</span>
|
||||
<span id="223">223</span>
|
||||
<span id="224">224</span>
|
||||
<span id="225">225</span>
|
||||
<span id="226">226</span>
|
||||
<span id="227">227</span>
|
||||
<span id="228">228</span>
|
||||
<span id="229">229</span>
|
||||
<span id="230">230</span>
|
||||
<span id="231">231</span>
|
||||
<span id="232">232</span>
|
||||
<span id="233">233</span>
|
||||
<span id="234">234</span>
|
||||
<span id="235">235</span>
|
||||
<span id="236">236</span>
|
||||
<span id="237">237</span>
|
||||
<span id="238">238</span>
|
||||
<span id="239">239</span>
|
||||
<span id="240">240</span>
|
||||
<span id="241">241</span>
|
||||
<span id="242">242</span>
|
||||
<span id="243">243</span>
|
||||
<span id="244">244</span>
|
||||
<span id="245">245</span>
|
||||
<span id="246">246</span>
|
||||
<span id="247">247</span>
|
||||
<span id="248">248</span>
|
||||
<span id="249">249</span>
|
||||
<span id="250">250</span>
|
||||
<span id="251">251</span>
|
||||
<span id="252">252</span>
|
||||
<span id="253">253</span>
|
||||
<span id="254">254</span>
|
||||
<span id="255">255</span>
|
||||
<span id="256">256</span>
|
||||
<span id="257">257</span>
|
||||
<span id="258">258</span>
|
||||
<span id="259">259</span>
|
||||
<span id="260">260</span>
|
||||
<span id="261">261</span>
|
||||
<span id="262">262</span>
|
||||
<span id="263">263</span>
|
||||
<span id="264">264</span>
|
||||
<span id="265">265</span>
|
||||
<span id="266">266</span>
|
||||
<span id="267">267</span>
|
||||
<span id="268">268</span>
|
||||
<span id="269">269</span>
|
||||
<span id="270">270</span>
|
||||
<span id="271">271</span>
|
||||
<span id="272">272</span>
|
||||
<span id="273">273</span>
|
||||
<span id="274">274</span>
|
||||
<span id="275">275</span>
|
||||
<span id="276">276</span>
|
||||
<span id="277">277</span>
|
||||
<span id="278">278</span>
|
||||
<span id="279">279</span>
|
||||
<span id="280">280</span>
|
||||
<span id="281">281</span>
|
||||
<span id="282">282</span>
|
||||
<span id="283">283</span>
|
||||
<span id="284">284</span>
|
||||
<span id="285">285</span>
|
||||
<span id="286">286</span>
|
||||
<span id="287">287</span>
|
||||
<span id="288">288</span>
|
||||
<span id="289">289</span>
|
||||
<span id="290">290</span>
|
||||
<span id="291">291</span>
|
||||
<span id="292">292</span>
|
||||
<span id="293">293</span>
|
||||
<span id="294">294</span>
|
||||
<span id="295">295</span>
|
||||
<span id="296">296</span>
|
||||
<span id="297">297</span>
|
||||
<span id="298">298</span>
|
||||
<span id="299">299</span>
|
||||
<span id="300">300</span>
|
||||
<span id="301">301</span>
|
||||
<span id="302">302</span>
|
||||
<span id="303">303</span>
|
||||
<span id="304">304</span>
|
||||
<span id="305">305</span>
|
||||
<span id="306">306</span>
|
||||
<span id="307">307</span>
|
||||
<span id="308">308</span>
|
||||
<span id="309">309</span>
|
||||
<span id="310">310</span>
|
||||
<span id="311">311</span>
|
||||
<span id="312">312</span>
|
||||
<span id="313">313</span>
|
||||
<span id="314">314</span>
|
||||
<span id="315">315</span>
|
||||
<span id="316">316</span>
|
||||
<span id="317">317</span>
|
||||
<span id="318">318</span>
|
||||
<span id="319">319</span>
|
||||
<span id="320">320</span>
|
||||
<span id="321">321</span>
|
||||
<span id="322">322</span>
|
||||
<span id="323">323</span>
|
||||
<span id="324">324</span>
|
||||
<span id="325">325</span>
|
||||
<span id="326">326</span>
|
||||
<span id="327">327</span>
|
||||
<span id="328">328</span>
|
||||
<span id="329">329</span>
|
||||
<span id="330">330</span>
|
||||
<span id="331">331</span>
|
||||
<span id="332">332</span>
|
||||
<span id="333">333</span>
|
||||
<span id="334">334</span>
|
||||
<span id="335">335</span>
|
||||
<span id="336">336</span>
|
||||
<span id="337">337</span>
|
||||
<span id="338">338</span>
|
||||
<span id="339">339</span>
|
||||
<span id="340">340</span>
|
||||
<span id="341">341</span>
|
||||
<span id="342">342</span>
|
||||
<span id="343">343</span>
|
||||
<span id="344">344</span>
|
||||
<span id="345">345</span>
|
||||
<span id="346">346</span>
|
||||
<span id="347">347</span>
|
||||
<span id="348">348</span>
|
||||
<span id="349">349</span>
|
||||
<span id="350">350</span>
|
||||
<span id="351">351</span>
|
||||
<span id="352">352</span>
|
||||
<span id="353">353</span>
|
||||
<span id="354">354</span>
|
||||
<span id="355">355</span>
|
||||
<span id="356">356</span>
|
||||
<span id="357">357</span>
|
||||
<span id="358">358</span>
|
||||
<span id="359">359</span>
|
||||
<span id="360">360</span>
|
||||
<span id="361">361</span>
|
||||
<span id="362">362</span>
|
||||
<span id="363">363</span>
|
||||
<span id="364">364</span>
|
||||
<span id="365">365</span>
|
||||
<span id="366">366</span>
|
||||
<span id="367">367</span>
|
||||
<span id="368">368</span>
|
||||
<span id="369">369</span>
|
||||
<span id="370">370</span>
|
||||
<span id="371">371</span>
|
||||
<span id="372">372</span>
|
||||
<span id="373">373</span>
|
||||
<span id="374">374</span>
|
||||
<span id="375">375</span>
|
||||
<span id="376">376</span>
|
||||
<span id="377">377</span>
|
||||
<span id="378">378</span>
|
||||
<span id="379">379</span>
|
||||
<span id="380">380</span>
|
||||
<span id="381">381</span>
|
||||
<span id="382">382</span>
|
||||
<span id="383">383</span>
|
||||
<span id="384">384</span>
|
||||
<span id="385">385</span>
|
||||
<span id="386">386</span>
|
||||
<span id="387">387</span>
|
||||
<span id="388">388</span>
|
||||
<span id="389">389</span>
|
||||
<span id="390">390</span>
|
||||
<span id="391">391</span>
|
||||
<span id="392">392</span>
|
||||
<span id="393">393</span>
|
||||
<span id="394">394</span>
|
||||
<span id="395">395</span>
|
||||
<span id="396">396</span>
|
||||
<span id="397">397</span>
|
||||
<span id="398">398</span>
|
||||
<span id="399">399</span>
|
||||
<span id="400">400</span>
|
||||
<span id="401">401</span>
|
||||
<span id="402">402</span>
|
||||
<span id="403">403</span>
|
||||
<span id="404">404</span>
|
||||
<span id="405">405</span>
|
||||
<span id="406">406</span>
|
||||
<span id="407">407</span>
|
||||
<span id="408">408</span>
|
||||
<span id="409">409</span>
|
||||
<span id="410">410</span>
|
||||
<span id="411">411</span>
|
||||
<span id="412">412</span>
|
||||
<span id="413">413</span>
|
||||
<span id="414">414</span>
|
||||
<span id="415">415</span>
|
||||
<span id="416">416</span>
|
||||
<span id="417">417</span>
|
||||
<span id="418">418</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="kw">super</span>::{<span class="ident">get_block_cache</span>, <span class="ident">BlockDevice</span>, <span class="ident">BLOCK_SZ</span>};
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::vec::Vec</span>;
|
||||
<span class="kw">use</span> <span class="ident">core::fmt</span>::{<span class="ident">Debug</span>, <span class="ident">Formatter</span>, <span class="prelude-ty">Result</span>};
|
||||
|
||||
<span class="kw">const</span> <span class="ident">EFS_MAGIC</span>: <span class="ident">u32</span> <span class="op">=</span> <span class="number">0x3b800001</span>;
|
||||
<span class="kw">const</span> <span class="ident">INODE_DIRECT_COUNT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">28</span>;
|
||||
<span class="kw">const</span> <span class="ident">NAME_LENGTH_LIMIT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">27</span>;
|
||||
<span class="kw">const</span> <span class="ident">INODE_INDIRECT1_COUNT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">BLOCK_SZ</span> <span class="op">/</span> <span class="number">4</span>;
|
||||
<span class="kw">const</span> <span class="ident">INODE_INDIRECT2_COUNT</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="op">*</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="kw">const</span> <span class="ident">DIRECT_BOUND</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">INODE_DIRECT_COUNT</span>;
|
||||
<span class="kw">const</span> <span class="ident">INDIRECT1_BOUND</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">DIRECT_BOUND</span> <span class="op">+</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused</span>)]</span>
|
||||
<span class="kw">const</span> <span class="ident">INDIRECT2_BOUND</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="ident">INDIRECT1_BOUND</span> <span class="op">+</span> <span class="ident">INODE_INDIRECT2_COUNT</span>;
|
||||
|
||||
<span class="attribute">#[<span class="ident">repr</span>(<span class="ident">C</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">SuperBlock</span> {
|
||||
<span class="ident">magic</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">total_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">inode_bitmap_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">inode_area_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">data_bitmap_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">data_area_blocks</span>: <span class="ident">u32</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Debug</span> <span class="kw">for</span> <span class="ident">SuperBlock</span> {
|
||||
<span class="kw">fn</span> <span class="ident">fmt</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw-2">&mut</span> <span class="ident">Formatter</span><span class="op"><</span><span class="lifetime">'_</span><span class="op">></span>) -> <span class="prelude-ty">Result</span> {
|
||||
<span class="ident">f</span>.<span class="ident">debug_struct</span>(<span class="string">"SuperBlock"</span>)
|
||||
.<span class="ident">field</span>(<span class="string">"total_blocks"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">total_blocks</span>)
|
||||
.<span class="ident">field</span>(<span class="string">"inode_bitmap_blocks"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">inode_bitmap_blocks</span>)
|
||||
.<span class="ident">field</span>(<span class="string">"inode_area_blocks"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">inode_area_blocks</span>)
|
||||
.<span class="ident">field</span>(<span class="string">"data_bitmap_blocks"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">data_bitmap_blocks</span>)
|
||||
.<span class="ident">field</span>(<span class="string">"data_area_blocks"</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">data_area_blocks</span>)
|
||||
.<span class="ident">finish</span>()
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">SuperBlock</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">initialize</span>(
|
||||
<span class="kw-2">&mut</span> <span class="self">self</span>,
|
||||
<span class="ident">total_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">inode_bitmap_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">inode_area_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">data_bitmap_blocks</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">data_area_blocks</span>: <span class="ident">u32</span>,
|
||||
) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::SuperBlock::initialize() begin"</span>);
|
||||
<span class="kw-2">*</span><span class="self">self</span> <span class="op">=</span> <span class="self">Self</span> {
|
||||
<span class="ident">magic</span>: <span class="ident">EFS_MAGIC</span>,
|
||||
<span class="ident">total_blocks</span>,
|
||||
<span class="ident">inode_bitmap_blocks</span>,
|
||||
<span class="ident">inode_area_blocks</span>,
|
||||
<span class="ident">data_bitmap_blocks</span>,
|
||||
<span class="ident">data_area_blocks</span>,
|
||||
}
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_valid</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">bool</span> {
|
||||
<span class="self">self</span>.<span class="ident">magic</span> <span class="op">==</span> <span class="ident">EFS_MAGIC</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">derive</span>(<span class="ident">PartialEq</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">enum</span> <span class="ident">DiskInodeType</span> {
|
||||
<span class="ident">File</span>,
|
||||
<span class="ident">Directory</span>,
|
||||
}
|
||||
|
||||
<span class="kw">type</span> <span class="ident">IndirectBlock</span> <span class="op">=</span> [<span class="ident">u32</span>; <span class="ident">BLOCK_SZ</span> <span class="op">/</span> <span class="number">4</span>];
|
||||
<span class="kw">type</span> <span class="ident">DataBlock</span> <span class="op">=</span> [<span class="ident">u8</span>; <span class="ident">BLOCK_SZ</span>];
|
||||
|
||||
<span class="attribute">#[<span class="ident">repr</span>(<span class="ident">C</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">DiskInode</span> {
|
||||
<span class="kw">pub</span> <span class="ident">size</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">direct</span>: [<span class="ident">u32</span>; <span class="ident">INODE_DIRECT_COUNT</span>],
|
||||
<span class="kw">pub</span> <span class="ident">indirect1</span>: <span class="ident">u32</span>,
|
||||
<span class="kw">pub</span> <span class="ident">indirect2</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">type_</span>: <span class="ident">DiskInodeType</span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">DiskInode</span> {
|
||||
<span class="doccomment">/// indirect1 and indirect2 block are allocated only when they are needed.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">initialize</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">type_</span>: <span class="ident">DiskInodeType</span>) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DiskInode::initialize() begin"</span>);
|
||||
<span class="self">self</span>.<span class="ident">size</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="self">self</span>.<span class="ident">direct</span>.<span class="ident">iter_mut</span>().<span class="ident">for_each</span>(<span class="op">|</span><span class="ident">v</span><span class="op">|</span> <span class="kw-2">*</span><span class="ident">v</span> <span class="op">=</span> <span class="number">0</span>);
|
||||
<span class="self">self</span>.<span class="ident">indirect1</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="self">self</span>.<span class="ident">indirect2</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="self">self</span>.<span class="ident">type_</span> <span class="op">=</span> <span class="ident">type_</span>;
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_dir</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">bool</span> {
|
||||
<span class="self">self</span>.<span class="ident">type_</span> <span class="op">==</span> <span class="ident">DiskInodeType::Directory</span>
|
||||
}
|
||||
<span class="attribute">#[<span class="ident">allow</span>(<span class="ident">unused</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">is_file</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">bool</span> {
|
||||
<span class="self">self</span>.<span class="ident">type_</span> <span class="op">==</span> <span class="ident">DiskInodeType::File</span>
|
||||
}
|
||||
<span class="doccomment">/// Return block number correspond to size.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">data_blocks</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">u32</span> {
|
||||
<span class="ident"><span class="self">Self</span>::_data_blocks</span>(<span class="self">self</span>.<span class="ident">size</span>)
|
||||
}
|
||||
<span class="kw">fn</span> <span class="ident">_data_blocks</span>(<span class="ident">size</span>: <span class="ident">u32</span>) -> <span class="ident">u32</span> {
|
||||
(<span class="ident">size</span> <span class="op">+</span> <span class="ident">BLOCK_SZ</span> <span class="kw">as</span> <span class="ident">u32</span> <span class="op">-</span> <span class="number">1</span>) <span class="op">/</span> <span class="ident">BLOCK_SZ</span> <span class="kw">as</span> <span class="ident">u32</span>
|
||||
}
|
||||
<span class="doccomment">/// Return number of blocks needed include indirect1/2.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">total_blocks</span>(<span class="ident">size</span>: <span class="ident">u32</span>) -> <span class="ident">u32</span> {
|
||||
<span class="kw">let</span> <span class="ident">data_blocks</span> <span class="op">=</span> <span class="ident"><span class="self">Self</span>::_data_blocks</span>(<span class="ident">size</span>) <span class="kw">as</span> <span class="ident">usize</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">total</span> <span class="op">=</span> <span class="ident">data_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>;
|
||||
<span class="comment">// indirect1</span>
|
||||
<span class="kw">if</span> <span class="ident">data_blocks</span> <span class="op">></span> <span class="ident">INODE_DIRECT_COUNT</span> {
|
||||
<span class="ident">total</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
<span class="comment">// indirect2</span>
|
||||
<span class="kw">if</span> <span class="ident">data_blocks</span> <span class="op">></span> <span class="ident">INDIRECT1_BOUND</span> {
|
||||
<span class="ident">total</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="comment">// sub indirect1</span>
|
||||
<span class="ident">total</span> <span class="op">+</span><span class="op">=</span>
|
||||
(<span class="ident">data_blocks</span> <span class="op">-</span> <span class="ident">INDIRECT1_BOUND</span> <span class="op">+</span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="op">-</span> <span class="number">1</span>) <span class="op">/</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
}
|
||||
<span class="ident">total</span> <span class="kw">as</span> <span class="ident">u32</span>
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">blocks_num_needed</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">new_size</span>: <span class="ident">u32</span>) -> <span class="ident">u32</span> {
|
||||
<span class="macro">assert!</span>(<span class="ident">new_size</span> <span class="op">></span><span class="op">=</span> <span class="self">self</span>.<span class="ident">size</span>);
|
||||
<span class="ident"><span class="self">Self</span>::total_blocks</span>(<span class="ident">new_size</span>) <span class="op">-</span> <span class="ident"><span class="self">Self</span>::total_blocks</span>(<span class="self">self</span>.<span class="ident">size</span>)
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">get_block_id</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">inner_id</span>: <span class="ident">u32</span>, <span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>) -> <span class="ident">u32</span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] layout::DiskInode::get_block_id() begin");</span>
|
||||
<span class="kw">let</span> <span class="ident">inner_id</span> <span class="op">=</span> <span class="ident">inner_id</span> <span class="kw">as</span> <span class="ident">usize</span>;
|
||||
<span class="kw">if</span> <span class="ident">inner_id</span> <span class="op"><</span> <span class="ident">INODE_DIRECT_COUNT</span> {
|
||||
<span class="self">self</span>.<span class="ident">direct</span>[<span class="ident">inner_id</span>]
|
||||
} <span class="kw">else</span> <span class="kw">if</span> <span class="ident">inner_id</span> <span class="op"><</span> <span class="ident">INDIRECT1_BOUND</span> {
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect1</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect_block</span>: <span class="kw-2">&</span><span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="ident">indirect_block</span>[<span class="ident">inner_id</span> <span class="op">-</span> <span class="ident">INODE_DIRECT_COUNT</span>]
|
||||
})
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">let</span> <span class="ident">last</span> <span class="op">=</span> <span class="ident">inner_id</span> <span class="op">-</span> <span class="ident">INDIRECT1_BOUND</span>;
|
||||
<span class="kw">let</span> <span class="ident">indirect1</span> <span class="op">=</span> <span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect2</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect2</span>: <span class="kw-2">&</span><span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="ident">indirect2</span>[<span class="ident">last</span> <span class="op">/</span> <span class="ident">INODE_INDIRECT1_COUNT</span>]
|
||||
});
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">indirect1</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&</span><span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="ident">indirect1</span>[<span class="ident">last</span> <span class="op">%</span> <span class="ident">INODE_INDIRECT1_COUNT</span>]
|
||||
})
|
||||
}
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">increase_size</span>(
|
||||
<span class="kw-2">&mut</span> <span class="self">self</span>,
|
||||
<span class="ident">new_size</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">new_blocks</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span>,
|
||||
<span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DiskInode::increase_size() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">current_blocks</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">data_blocks</span>();
|
||||
<span class="self">self</span>.<span class="ident">size</span> <span class="op">=</span> <span class="ident">new_size</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">total_blocks</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">data_blocks</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">new_blocks</span> <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">into_iter</span>();
|
||||
<span class="comment">// fill direct</span>
|
||||
<span class="kw">while</span> <span class="ident">current_blocks</span> <span class="op"><</span> <span class="ident">total_blocks</span>.<span class="ident">min</span>(<span class="ident">INODE_DIRECT_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>) {
|
||||
<span class="self">self</span>.<span class="ident">direct</span>[<span class="ident">current_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>] <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
<span class="ident">current_blocks</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
<span class="comment">// alloc indirect1</span>
|
||||
<span class="kw">if</span> <span class="ident">total_blocks</span> <span class="op">></span> <span class="ident">INODE_DIRECT_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span> {
|
||||
<span class="kw">if</span> <span class="ident">current_blocks</span> <span class="op">==</span> <span class="ident">INODE_DIRECT_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">indirect1</span> <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
}
|
||||
<span class="ident">current_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_DIRECT_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
<span class="ident">total_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_DIRECT_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">// fill indirect1</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect1</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="kw">while</span> <span class="ident">current_blocks</span> <span class="op"><</span> <span class="ident">total_blocks</span>.<span class="ident">min</span>(<span class="ident">INODE_INDIRECT1_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>) {
|
||||
<span class="ident">indirect1</span>[<span class="ident">current_blocks</span> <span class="kw">as</span> <span class="ident">usize</span>] <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
<span class="ident">current_blocks</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
});
|
||||
<span class="comment">// alloc indirect2</span>
|
||||
<span class="kw">if</span> <span class="ident">total_blocks</span> <span class="op">></span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span> {
|
||||
<span class="kw">if</span> <span class="ident">current_blocks</span> <span class="op">==</span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">indirect2</span> <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
}
|
||||
<span class="ident">current_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
<span class="ident">total_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_INDIRECT1_COUNT</span> <span class="kw">as</span> <span class="ident">u32</span>;
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="comment">// fill indirect2 from (a0, b0) -> (a1, b1)</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">a0</span> <span class="op">=</span> <span class="ident">current_blocks</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">/</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">b0</span> <span class="op">=</span> <span class="ident">current_blocks</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">%</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="kw">let</span> <span class="ident">a1</span> <span class="op">=</span> <span class="ident">total_blocks</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">/</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="kw">let</span> <span class="ident">b1</span> <span class="op">=</span> <span class="ident">total_blocks</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="op">%</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="comment">// alloc low-level indirect1</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect2</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect2</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="kw">while</span> (<span class="ident">a0</span> <span class="op"><</span> <span class="ident">a1</span>) <span class="op">|</span><span class="op">|</span> (<span class="ident">a0</span> <span class="op">==</span> <span class="ident">a1</span> <span class="op">&&</span> <span class="ident">b0</span> <span class="op"><</span> <span class="ident">b1</span>) {
|
||||
<span class="kw">if</span> <span class="ident">b0</span> <span class="op">==</span> <span class="number">0</span> {
|
||||
<span class="ident">indirect2</span>[<span class="ident">a0</span>] <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
}
|
||||
<span class="comment">// fill current</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">indirect2</span>[<span class="ident">a0</span>] <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="ident">indirect1</span>[<span class="ident">b0</span>] <span class="op">=</span> <span class="ident">new_blocks</span>.<span class="ident">next</span>().<span class="ident">unwrap</span>();
|
||||
});
|
||||
<span class="comment">// move to next</span>
|
||||
<span class="ident">b0</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="kw">if</span> <span class="ident">b0</span> <span class="op">==</span> <span class="ident">INODE_INDIRECT1_COUNT</span> {
|
||||
<span class="ident">b0</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="ident">a0</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
<span class="doccomment">/// Clear size to zero and return blocks that should be deallocated.</span>
|
||||
<span class="doccomment">///</span>
|
||||
<span class="doccomment">/// We will clear the block contents to zero later.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear_size</span>(<span class="kw-2">&mut</span> <span class="self">self</span>, <span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>) -> <span class="ident">Vec</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DiskInode::clear_size() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">data_blocks</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">data_blocks</span>() <span class="kw">as</span> <span class="ident">usize</span>;
|
||||
<span class="self">self</span>.<span class="ident">size</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">current_blocks</span> <span class="op">=</span> <span class="number">0usize</span>;
|
||||
<span class="comment">// direct</span>
|
||||
<span class="kw">while</span> <span class="ident">current_blocks</span> <span class="op"><</span> <span class="ident">data_blocks</span>.<span class="ident">min</span>(<span class="ident">INODE_DIRECT_COUNT</span>) {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="self">self</span>.<span class="ident">direct</span>[<span class="ident">current_blocks</span>]);
|
||||
<span class="self">self</span>.<span class="ident">direct</span>[<span class="ident">current_blocks</span>] <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="ident">current_blocks</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
<span class="comment">// indirect1 block</span>
|
||||
<span class="kw">if</span> <span class="ident">data_blocks</span> <span class="op">></span> <span class="ident">INODE_DIRECT_COUNT</span> {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="self">self</span>.<span class="ident">indirect1</span>);
|
||||
<span class="ident">data_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_DIRECT_COUNT</span>;
|
||||
<span class="ident">current_blocks</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">return</span> <span class="ident">v</span>;
|
||||
}
|
||||
<span class="comment">// indirect1</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect1</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="kw">while</span> <span class="ident">current_blocks</span> <span class="op"><</span> <span class="ident">data_blocks</span>.<span class="ident">min</span>(<span class="ident">INODE_INDIRECT1_COUNT</span>) {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">indirect1</span>[<span class="ident">current_blocks</span>]);
|
||||
<span class="comment">//indirect1[current_blocks] = 0;</span>
|
||||
<span class="ident">current_blocks</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
}
|
||||
});
|
||||
<span class="self">self</span>.<span class="ident">indirect1</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="comment">// indirect2 block</span>
|
||||
<span class="kw">if</span> <span class="ident">data_blocks</span> <span class="op">></span> <span class="ident">INODE_INDIRECT1_COUNT</span> {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="self">self</span>.<span class="ident">indirect2</span>);
|
||||
<span class="ident">data_blocks</span> <span class="op">-</span><span class="op">=</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
} <span class="kw">else</span> {
|
||||
<span class="kw">return</span> <span class="ident">v</span>;
|
||||
}
|
||||
<span class="comment">// indirect2</span>
|
||||
<span class="macro">assert!</span>(<span class="ident">data_blocks</span> <span class="op"><</span><span class="op">=</span> <span class="ident">INODE_INDIRECT2_COUNT</span>);
|
||||
<span class="kw">let</span> <span class="ident">a1</span> <span class="op">=</span> <span class="ident">data_blocks</span> <span class="op">/</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="kw">let</span> <span class="ident">b1</span> <span class="op">=</span> <span class="ident">data_blocks</span> <span class="op">%</span> <span class="ident">INODE_INDIRECT1_COUNT</span>;
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">indirect2</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect2</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="comment">// full indirect1 blocks</span>
|
||||
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">indirect2</span>.<span class="ident">iter_mut</span>().<span class="ident">take</span>(<span class="ident">a1</span>) {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">entry</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="kw-2">*</span><span class="ident">entry</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">indirect1</span>.<span class="ident">iter</span>() {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">entry</span>);
|
||||
}
|
||||
});
|
||||
}
|
||||
<span class="comment">// last indirect1 block</span>
|
||||
<span class="kw">if</span> <span class="ident">b1</span> <span class="op">></span> <span class="number">0</span> {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">indirect2</span>[<span class="ident">a1</span>]);
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">indirect2</span>[<span class="ident">a1</span>] <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">indirect1</span>: <span class="kw-2">&mut</span> <span class="ident">IndirectBlock</span><span class="op">|</span> {
|
||||
<span class="kw">for</span> <span class="ident">entry</span> <span class="kw">in</span> <span class="ident">indirect1</span>.<span class="ident">iter</span>().<span class="ident">take</span>(<span class="ident">b1</span>) {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="kw-2">*</span><span class="ident">entry</span>);
|
||||
}
|
||||
});
|
||||
<span class="comment">//indirect2[a1] = 0;</span>
|
||||
}
|
||||
});
|
||||
<span class="self">self</span>.<span class="ident">indirect2</span> <span class="op">=</span> <span class="number">0</span>;
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DiskInode::clear_size() end"</span>);
|
||||
<span class="ident">v</span>
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">read_at</span>(
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
<span class="ident">offset</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">buf</span>: <span class="kw-2">&mut</span> [<span class="ident">u8</span>],
|
||||
<span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) -> <span class="ident">usize</span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] layout::DiskInode::read_at() begin");</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">start</span> <span class="op">=</span> <span class="ident">offset</span>;
|
||||
<span class="kw">let</span> <span class="ident">end</span> <span class="op">=</span> (<span class="ident">offset</span> <span class="op">+</span> <span class="ident">buf</span>.<span class="ident">len</span>()).<span class="ident">min</span>(<span class="self">self</span>.<span class="ident">size</span> <span class="kw">as</span> <span class="ident">usize</span>);
|
||||
<span class="kw">if</span> <span class="ident">start</span> <span class="op">></span><span class="op">=</span> <span class="ident">end</span> {
|
||||
<span class="kw">return</span> <span class="number">0</span>;
|
||||
}
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">start_block</span> <span class="op">=</span> <span class="ident">start</span> <span class="op">/</span> <span class="ident">BLOCK_SZ</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">read_size</span> <span class="op">=</span> <span class="number">0usize</span>;
|
||||
<span class="kw">loop</span> {
|
||||
<span class="comment">// calculate end of current block</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">end_current_block</span> <span class="op">=</span> (<span class="ident">start</span> <span class="op">/</span> <span class="ident">BLOCK_SZ</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="ident">BLOCK_SZ</span>;
|
||||
<span class="ident">end_current_block</span> <span class="op">=</span> <span class="ident">end_current_block</span>.<span class="ident">min</span>(<span class="ident">end</span>);
|
||||
<span class="comment">// read and update read size</span>
|
||||
<span class="kw">let</span> <span class="ident">block_read_size</span> <span class="op">=</span> <span class="ident">end_current_block</span> <span class="op">-</span> <span class="ident">start</span>;
|
||||
<span class="kw">let</span> <span class="ident">dst</span> <span class="op">=</span> <span class="kw-2">&mut</span> <span class="ident">buf</span>[<span class="ident">read_size</span>..<span class="ident">read_size</span> <span class="op">+</span> <span class="ident">block_read_size</span>];
|
||||
<span class="ident">get_block_cache</span>(
|
||||
<span class="self">self</span>.<span class="ident">get_block_id</span>(<span class="ident">start_block</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">block_device</span>) <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">Arc::clone</span>(<span class="ident">block_device</span>),
|
||||
)
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">data_block</span>: <span class="kw-2">&</span><span class="ident">DataBlock</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">src</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">data_block</span>[<span class="ident">start</span> <span class="op">%</span> <span class="ident">BLOCK_SZ</span>..<span class="ident">start</span> <span class="op">%</span> <span class="ident">BLOCK_SZ</span> <span class="op">+</span> <span class="ident">block_read_size</span>];
|
||||
<span class="ident">dst</span>.<span class="ident">copy_from_slice</span>(<span class="ident">src</span>);
|
||||
});
|
||||
<span class="ident">read_size</span> <span class="op">+</span><span class="op">=</span> <span class="ident">block_read_size</span>;
|
||||
<span class="comment">// move to next block</span>
|
||||
<span class="kw">if</span> <span class="ident">end_current_block</span> <span class="op">==</span> <span class="ident">end</span> {
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
<span class="ident">start_block</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="ident">start</span> <span class="op">=</span> <span class="ident">end_current_block</span>;
|
||||
}
|
||||
<span class="ident">read_size</span>
|
||||
}
|
||||
<span class="doccomment">/// File size must be adjusted before.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">write_at</span>(
|
||||
<span class="kw-2">&mut</span> <span class="self">self</span>,
|
||||
<span class="ident">offset</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">buf</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>],
|
||||
<span class="ident">block_device</span>: <span class="kw-2">&</span><span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) -> <span class="ident">usize</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DiskInode::write_at() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">start</span> <span class="op">=</span> <span class="ident">offset</span>;
|
||||
<span class="kw">let</span> <span class="ident">end</span> <span class="op">=</span> (<span class="ident">offset</span> <span class="op">+</span> <span class="ident">buf</span>.<span class="ident">len</span>()).<span class="ident">min</span>(<span class="self">self</span>.<span class="ident">size</span> <span class="kw">as</span> <span class="ident">usize</span>);
|
||||
<span class="macro">assert!</span>(<span class="ident">start</span> <span class="op"><</span><span class="op">=</span> <span class="ident">end</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">start_block</span> <span class="op">=</span> <span class="ident">start</span> <span class="op">/</span> <span class="ident">BLOCK_SZ</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">write_size</span> <span class="op">=</span> <span class="number">0usize</span>;
|
||||
<span class="kw">loop</span> {
|
||||
<span class="comment">// calculate end of current block</span>
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">end_current_block</span> <span class="op">=</span> (<span class="ident">start</span> <span class="op">/</span> <span class="ident">BLOCK_SZ</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="ident">BLOCK_SZ</span>;
|
||||
<span class="ident">end_current_block</span> <span class="op">=</span> <span class="ident">end_current_block</span>.<span class="ident">min</span>(<span class="ident">end</span>);
|
||||
<span class="comment">// write and update write size</span>
|
||||
<span class="kw">let</span> <span class="ident">block_write_size</span> <span class="op">=</span> <span class="ident">end_current_block</span> <span class="op">-</span> <span class="ident">start</span>;
|
||||
<span class="ident">get_block_cache</span>(
|
||||
<span class="self">self</span>.<span class="ident">get_block_id</span>(<span class="ident">start_block</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">block_device</span>) <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">Arc::clone</span>(<span class="ident">block_device</span>),
|
||||
)
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="number">0</span>, <span class="op">|</span><span class="ident">data_block</span>: <span class="kw-2">&mut</span> <span class="ident">DataBlock</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">src</span> <span class="op">=</span> <span class="kw-2">&</span><span class="ident">buf</span>[<span class="ident">write_size</span>..<span class="ident">write_size</span> <span class="op">+</span> <span class="ident">block_write_size</span>];
|
||||
<span class="kw">let</span> <span class="ident">dst</span> <span class="op">=</span> <span class="kw-2">&mut</span> <span class="ident">data_block</span>[<span class="ident">start</span> <span class="op">%</span> <span class="ident">BLOCK_SZ</span>..<span class="ident">start</span> <span class="op">%</span> <span class="ident">BLOCK_SZ</span> <span class="op">+</span> <span class="ident">block_write_size</span>];
|
||||
<span class="ident">dst</span>.<span class="ident">copy_from_slice</span>(<span class="ident">src</span>);
|
||||
});
|
||||
<span class="ident">write_size</span> <span class="op">+</span><span class="op">=</span> <span class="ident">block_write_size</span>;
|
||||
<span class="comment">// move to next block</span>
|
||||
<span class="kw">if</span> <span class="ident">end_current_block</span> <span class="op">==</span> <span class="ident">end</span> {
|
||||
<span class="kw">break</span>;
|
||||
}
|
||||
<span class="ident">start_block</span> <span class="op">+</span><span class="op">=</span> <span class="number">1</span>;
|
||||
<span class="ident">start</span> <span class="op">=</span> <span class="ident">end_current_block</span>;
|
||||
}
|
||||
<span class="ident">write_size</span>
|
||||
}
|
||||
}
|
||||
|
||||
<span class="attribute">#[<span class="ident">repr</span>(<span class="ident">C</span>)]</span>
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">DirEntry</span> {
|
||||
<span class="ident">name</span>: [<span class="ident">u8</span>; <span class="ident">NAME_LENGTH_LIMIT</span> <span class="op">+</span> <span class="number">1</span>],
|
||||
<span class="ident">inode_number</span>: <span class="ident">u32</span>,
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">DIRENT_SZ</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">32</span>;
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">DirEntry</span> {
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">empty</span>() -> <span class="self">Self</span> {
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">name</span>: [<span class="number">0u8</span>; <span class="ident">NAME_LENGTH_LIMIT</span> <span class="op">+</span> <span class="number">1</span>],
|
||||
<span class="ident">inode_number</span>: <span class="number">0</span>,
|
||||
}
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(<span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">inode_number</span>: <span class="ident">u32</span>) -> <span class="self">Self</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] layout::DirEntry::new() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">bytes</span> <span class="op">=</span> [<span class="number">0u8</span>; <span class="ident">NAME_LENGTH_LIMIT</span> <span class="op">+</span> <span class="number">1</span>];
|
||||
<span class="ident">bytes</span>[..<span class="ident">name</span>.<span class="ident">len</span>()].<span class="ident">copy_from_slice</span>(<span class="ident">name</span>.<span class="ident">as_bytes</span>());
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">name</span>: <span class="ident">bytes</span>,
|
||||
<span class="ident">inode_number</span>,
|
||||
}
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_bytes</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="kw-2">&</span>[<span class="ident">u8</span>] {
|
||||
<span class="kw">unsafe</span> { <span class="ident">core::slice::from_raw_parts</span>(<span class="self">self</span> <span class="kw">as</span> <span class="kw-2">*const</span> <span class="kw">_</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="kw">as</span> <span class="kw-2">*const</span> <span class="ident">u8</span>, <span class="ident">DIRENT_SZ</span>) }
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">as_bytes_mut</span>(<span class="kw-2">&mut</span> <span class="self">self</span>) -> <span class="kw-2">&mut</span> [<span class="ident">u8</span>] {
|
||||
<span class="kw">unsafe</span> { <span class="ident">core::slice::from_raw_parts_mut</span>(<span class="self">self</span> <span class="kw">as</span> <span class="kw-2">*mut</span> <span class="kw">_</span> <span class="kw">as</span> <span class="ident">usize</span> <span class="kw">as</span> <span class="kw-2">*mut</span> <span class="ident">u8</span>, <span class="ident">DIRENT_SZ</span>) }
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">name</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="kw-2">&</span><span class="ident">str</span> {
|
||||
<span class="kw">let</span> <span class="ident">len</span> <span class="op">=</span> (<span class="number">0usize</span>..).<span class="ident">find</span>(<span class="op">|</span><span class="ident">i</span><span class="op">|</span> <span class="self">self</span>.<span class="ident">name</span>[<span class="kw-2">*</span><span class="ident">i</span>] <span class="op">==</span> <span class="number">0</span>).<span class="ident">unwrap</span>();
|
||||
<span class="ident">core::str::from_utf8</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">name</span>[..<span class="ident">len</span>]).<span class="ident">unwrap</span>()
|
||||
}
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">inode_number</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">u32</span> {
|
||||
<span class="self">self</span>.<span class="ident">inode_number</span>
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
42
ch9-log/src/os/fs/easy_fs/mod.rs.html
Normal file
42
ch9-log/src/os/fs/easy_fs/mod.rs.html
Normal file
@ -0,0 +1,42 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/mod.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>mod.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10">10</span>
|
||||
<span id="11">11</span>
|
||||
<span id="12">12</span>
|
||||
<span id="13">13</span>
|
||||
<span id="14">14</span>
|
||||
<span id="15">15</span>
|
||||
<span id="16">16</span>
|
||||
<span id="17">17</span>
|
||||
<span id="18">18</span>
|
||||
</pre><pre class="rust"><code><span class="comment">// #![no_std]</span>
|
||||
|
||||
<span class="comment">// extern crate alloc;</span>
|
||||
|
||||
<span class="kw">mod</span> <span class="ident">bitmap</span>;
|
||||
<span class="kw">mod</span> <span class="ident">block_cache</span>;
|
||||
<span class="kw">mod</span> <span class="ident">block_dev</span>;
|
||||
<span class="kw">mod</span> <span class="ident">efs</span>;
|
||||
<span class="kw">mod</span> <span class="ident">layout</span>;
|
||||
<span class="kw">mod</span> <span class="ident">vfs</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">const</span> <span class="ident">BLOCK_SZ</span>: <span class="ident">usize</span> <span class="op">=</span> <span class="number">512</span>;
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">bitmap::Bitmap</span>;
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">block_cache</span>::{<span class="ident">block_cache_sync_all</span>, <span class="ident">get_block_cache</span>};
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">block_dev::BlockDevice</span>;
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">efs::EasyFileSystem</span>;
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">layout</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">vfs::Inode</span>;
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
402
ch9-log/src/os/fs/easy_fs/vfs.rs.html
Normal file
402
ch9-log/src/os/fs/easy_fs/vfs.rs.html
Normal file
@ -0,0 +1,402 @@
|
||||
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Source of the Rust file `src/fs/easy_fs/vfs.rs`."><meta name="keywords" content="rust, rustlang, rust-lang"><title>vfs.rs - source</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" type="text/css" href="../../../../normalize.css"><link rel="stylesheet" type="text/css" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../../../../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../../../../dark.css" disabled><link rel="stylesheet" type="text/css" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script src="../../../../crates.js"></script><script defer src="../../../../main.js"></script><script defer src="../../../../source-script.js"></script><script defer src="../../../../source-files.js"></script>
|
||||
<noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc source"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">☰</div><a class="sidebar-logo" href="../../../../os/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div>
|
||||
</a></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../os/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><div class="theme-picker hidden"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../../../../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div>
|
||||
<input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../../../../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../../../../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><div class="example-wrap"><pre class="line-numbers"><span id="1"> 1</span>
|
||||
<span id="2"> 2</span>
|
||||
<span id="3"> 3</span>
|
||||
<span id="4"> 4</span>
|
||||
<span id="5"> 5</span>
|
||||
<span id="6"> 6</span>
|
||||
<span id="7"> 7</span>
|
||||
<span id="8"> 8</span>
|
||||
<span id="9"> 9</span>
|
||||
<span id="10"> 10</span>
|
||||
<span id="11"> 11</span>
|
||||
<span id="12"> 12</span>
|
||||
<span id="13"> 13</span>
|
||||
<span id="14"> 14</span>
|
||||
<span id="15"> 15</span>
|
||||
<span id="16"> 16</span>
|
||||
<span id="17"> 17</span>
|
||||
<span id="18"> 18</span>
|
||||
<span id="19"> 19</span>
|
||||
<span id="20"> 20</span>
|
||||
<span id="21"> 21</span>
|
||||
<span id="22"> 22</span>
|
||||
<span id="23"> 23</span>
|
||||
<span id="24"> 24</span>
|
||||
<span id="25"> 25</span>
|
||||
<span id="26"> 26</span>
|
||||
<span id="27"> 27</span>
|
||||
<span id="28"> 28</span>
|
||||
<span id="29"> 29</span>
|
||||
<span id="30"> 30</span>
|
||||
<span id="31"> 31</span>
|
||||
<span id="32"> 32</span>
|
||||
<span id="33"> 33</span>
|
||||
<span id="34"> 34</span>
|
||||
<span id="35"> 35</span>
|
||||
<span id="36"> 36</span>
|
||||
<span id="37"> 37</span>
|
||||
<span id="38"> 38</span>
|
||||
<span id="39"> 39</span>
|
||||
<span id="40"> 40</span>
|
||||
<span id="41"> 41</span>
|
||||
<span id="42"> 42</span>
|
||||
<span id="43"> 43</span>
|
||||
<span id="44"> 44</span>
|
||||
<span id="45"> 45</span>
|
||||
<span id="46"> 46</span>
|
||||
<span id="47"> 47</span>
|
||||
<span id="48"> 48</span>
|
||||
<span id="49"> 49</span>
|
||||
<span id="50"> 50</span>
|
||||
<span id="51"> 51</span>
|
||||
<span id="52"> 52</span>
|
||||
<span id="53"> 53</span>
|
||||
<span id="54"> 54</span>
|
||||
<span id="55"> 55</span>
|
||||
<span id="56"> 56</span>
|
||||
<span id="57"> 57</span>
|
||||
<span id="58"> 58</span>
|
||||
<span id="59"> 59</span>
|
||||
<span id="60"> 60</span>
|
||||
<span id="61"> 61</span>
|
||||
<span id="62"> 62</span>
|
||||
<span id="63"> 63</span>
|
||||
<span id="64"> 64</span>
|
||||
<span id="65"> 65</span>
|
||||
<span id="66"> 66</span>
|
||||
<span id="67"> 67</span>
|
||||
<span id="68"> 68</span>
|
||||
<span id="69"> 69</span>
|
||||
<span id="70"> 70</span>
|
||||
<span id="71"> 71</span>
|
||||
<span id="72"> 72</span>
|
||||
<span id="73"> 73</span>
|
||||
<span id="74"> 74</span>
|
||||
<span id="75"> 75</span>
|
||||
<span id="76"> 76</span>
|
||||
<span id="77"> 77</span>
|
||||
<span id="78"> 78</span>
|
||||
<span id="79"> 79</span>
|
||||
<span id="80"> 80</span>
|
||||
<span id="81"> 81</span>
|
||||
<span id="82"> 82</span>
|
||||
<span id="83"> 83</span>
|
||||
<span id="84"> 84</span>
|
||||
<span id="85"> 85</span>
|
||||
<span id="86"> 86</span>
|
||||
<span id="87"> 87</span>
|
||||
<span id="88"> 88</span>
|
||||
<span id="89"> 89</span>
|
||||
<span id="90"> 90</span>
|
||||
<span id="91"> 91</span>
|
||||
<span id="92"> 92</span>
|
||||
<span id="93"> 93</span>
|
||||
<span id="94"> 94</span>
|
||||
<span id="95"> 95</span>
|
||||
<span id="96"> 96</span>
|
||||
<span id="97"> 97</span>
|
||||
<span id="98"> 98</span>
|
||||
<span id="99"> 99</span>
|
||||
<span id="100">100</span>
|
||||
<span id="101">101</span>
|
||||
<span id="102">102</span>
|
||||
<span id="103">103</span>
|
||||
<span id="104">104</span>
|
||||
<span id="105">105</span>
|
||||
<span id="106">106</span>
|
||||
<span id="107">107</span>
|
||||
<span id="108">108</span>
|
||||
<span id="109">109</span>
|
||||
<span id="110">110</span>
|
||||
<span id="111">111</span>
|
||||
<span id="112">112</span>
|
||||
<span id="113">113</span>
|
||||
<span id="114">114</span>
|
||||
<span id="115">115</span>
|
||||
<span id="116">116</span>
|
||||
<span id="117">117</span>
|
||||
<span id="118">118</span>
|
||||
<span id="119">119</span>
|
||||
<span id="120">120</span>
|
||||
<span id="121">121</span>
|
||||
<span id="122">122</span>
|
||||
<span id="123">123</span>
|
||||
<span id="124">124</span>
|
||||
<span id="125">125</span>
|
||||
<span id="126">126</span>
|
||||
<span id="127">127</span>
|
||||
<span id="128">128</span>
|
||||
<span id="129">129</span>
|
||||
<span id="130">130</span>
|
||||
<span id="131">131</span>
|
||||
<span id="132">132</span>
|
||||
<span id="133">133</span>
|
||||
<span id="134">134</span>
|
||||
<span id="135">135</span>
|
||||
<span id="136">136</span>
|
||||
<span id="137">137</span>
|
||||
<span id="138">138</span>
|
||||
<span id="139">139</span>
|
||||
<span id="140">140</span>
|
||||
<span id="141">141</span>
|
||||
<span id="142">142</span>
|
||||
<span id="143">143</span>
|
||||
<span id="144">144</span>
|
||||
<span id="145">145</span>
|
||||
<span id="146">146</span>
|
||||
<span id="147">147</span>
|
||||
<span id="148">148</span>
|
||||
<span id="149">149</span>
|
||||
<span id="150">150</span>
|
||||
<span id="151">151</span>
|
||||
<span id="152">152</span>
|
||||
<span id="153">153</span>
|
||||
<span id="154">154</span>
|
||||
<span id="155">155</span>
|
||||
<span id="156">156</span>
|
||||
<span id="157">157</span>
|
||||
<span id="158">158</span>
|
||||
<span id="159">159</span>
|
||||
<span id="160">160</span>
|
||||
<span id="161">161</span>
|
||||
<span id="162">162</span>
|
||||
<span id="163">163</span>
|
||||
<span id="164">164</span>
|
||||
<span id="165">165</span>
|
||||
<span id="166">166</span>
|
||||
<span id="167">167</span>
|
||||
<span id="168">168</span>
|
||||
<span id="169">169</span>
|
||||
<span id="170">170</span>
|
||||
<span id="171">171</span>
|
||||
<span id="172">172</span>
|
||||
<span id="173">173</span>
|
||||
<span id="174">174</span>
|
||||
<span id="175">175</span>
|
||||
<span id="176">176</span>
|
||||
<span id="177">177</span>
|
||||
<span id="178">178</span>
|
||||
<span id="179">179</span>
|
||||
<span id="180">180</span>
|
||||
<span id="181">181</span>
|
||||
<span id="182">182</span>
|
||||
<span id="183">183</span>
|
||||
<span id="184">184</span>
|
||||
<span id="185">185</span>
|
||||
<span id="186">186</span>
|
||||
<span id="187">187</span>
|
||||
<span id="188">188</span>
|
||||
<span id="189">189</span>
|
||||
<span id="190">190</span>
|
||||
<span id="191">191</span>
|
||||
<span id="192">192</span>
|
||||
<span id="193">193</span>
|
||||
<span id="194">194</span>
|
||||
<span id="195">195</span>
|
||||
<span id="196">196</span>
|
||||
<span id="197">197</span>
|
||||
<span id="198">198</span>
|
||||
</pre><pre class="rust"><code><span class="kw">use</span> <span class="kw">super</span>::{
|
||||
<span class="ident">block_cache_sync_all</span>, <span class="ident">get_block_cache</span>, <span class="ident">BlockDevice</span>, <span class="ident">DirEntry</span>, <span class="ident">DiskInode</span>, <span class="ident">DiskInodeType</span>,
|
||||
<span class="ident">EasyFileSystem</span>, <span class="ident">DIRENT_SZ</span>,
|
||||
};
|
||||
<span class="kw">use</span> <span class="ident">alloc::string::String</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::vec::Vec</span>;
|
||||
<span class="kw">use</span> <span class="ident">spin</span>::{<span class="ident">Mutex</span>, <span class="ident">MutexGuard</span>};
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">Inode</span> {
|
||||
<span class="ident">block_id</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">block_offset</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">fs</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">EasyFileSystem</span><span class="op">></span><span class="op">></span>,
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
}
|
||||
|
||||
<span class="kw">impl</span> <span class="ident">Inode</span> {
|
||||
<span class="doccomment">/// We should not acquire efs lock here.</span>
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">new</span>(
|
||||
<span class="ident">block_id</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">block_offset</span>: <span class="ident">usize</span>,
|
||||
<span class="ident">fs</span>: <span class="ident">Arc</span><span class="op"><</span><span class="ident">Mutex</span><span class="op"><</span><span class="ident">EasyFileSystem</span><span class="op">></span><span class="op">></span>,
|
||||
<span class="ident">block_device</span>: <span class="ident">Arc</span><span class="op"><</span><span class="kw">dyn</span> <span class="ident">BlockDevice</span><span class="op">></span>,
|
||||
) -> <span class="self">Self</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::new() begin"</span>);
|
||||
<span class="self">Self</span> {
|
||||
<span class="ident">block_id</span>: <span class="ident">block_id</span> <span class="kw">as</span> <span class="ident">usize</span>,
|
||||
<span class="ident">block_offset</span>,
|
||||
<span class="ident">fs</span>,
|
||||
<span class="ident">block_device</span>,
|
||||
}
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">read_disk_inode</span><span class="op"><</span><span class="ident">V</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw">impl</span> <span class="ident">FnOnce</span>(<span class="kw-2">&</span><span class="ident">DiskInode</span>) -> <span class="ident">V</span>) -> <span class="ident">V</span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] vfs::Inode::read_disk_inode() begin");</span>
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">block_id</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">read</span>(<span class="self">self</span>.<span class="ident">block_offset</span>, <span class="ident">f</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">modify_disk_inode</span><span class="op"><</span><span class="ident">V</span><span class="op">></span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">f</span>: <span class="kw">impl</span> <span class="ident">FnOnce</span>(<span class="kw-2">&mut</span> <span class="ident">DiskInode</span>) -> <span class="ident">V</span>) -> <span class="ident">V</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::modify_disk_inode() begin"</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="self">self</span>.<span class="ident">block_id</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="self">self</span>.<span class="ident">block_offset</span>, <span class="ident">f</span>)
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">find_inode_id</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>, <span class="ident">disk_inode</span>: <span class="kw-2">&</span><span class="ident">DiskInode</span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::find_inode_id() begin"</span>);
|
||||
<span class="comment">// assert it is a directory</span>
|
||||
<span class="macro">assert!</span>(<span class="ident">disk_inode</span>.<span class="ident">is_dir</span>());
|
||||
<span class="kw">let</span> <span class="ident">file_count</span> <span class="op">=</span> (<span class="ident">disk_inode</span>.<span class="ident">size</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="ident">DIRENT_SZ</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dirent</span> <span class="op">=</span> <span class="ident">DirEntry::empty</span>();
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">file_count</span> {
|
||||
<span class="macro">assert_eq!</span>(
|
||||
<span class="ident">disk_inode</span>.<span class="ident">read_at</span>(<span class="ident">DIRENT_SZ</span> <span class="op">*</span> <span class="ident">i</span>, <span class="ident">dirent</span>.<span class="ident">as_bytes_mut</span>(), <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>,),
|
||||
<span class="ident">DIRENT_SZ</span>,
|
||||
);
|
||||
<span class="kw">if</span> <span class="ident">dirent</span>.<span class="ident">name</span>() <span class="op">==</span> <span class="ident">name</span> {
|
||||
<span class="kw">return</span> <span class="prelude-val">Some</span>(<span class="ident">dirent</span>.<span class="ident">inode_number</span>() <span class="kw">as</span> <span class="ident">u32</span>);
|
||||
}
|
||||
}
|
||||
<span class="prelude-val">None</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">find</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Inode</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::find() begin"</span>);
|
||||
<span class="kw">let</span> <span class="ident">fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="self">self</span>.<span class="ident">read_disk_inode</span>(<span class="op">|</span><span class="ident">disk_inode</span><span class="op">|</span> {
|
||||
<span class="self">self</span>.<span class="ident">find_inode_id</span>(<span class="ident">name</span>, <span class="ident">disk_inode</span>).<span class="ident">map</span>(<span class="op">|</span><span class="ident">inode_id</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> (<span class="ident">block_id</span>, <span class="ident">block_offset</span>) <span class="op">=</span> <span class="ident">fs</span>.<span class="ident">get_disk_inode_pos</span>(<span class="ident">inode_id</span>);
|
||||
<span class="ident">Arc::new</span>(<span class="ident"><span class="self">Self</span>::new</span>(
|
||||
<span class="ident">block_id</span>,
|
||||
<span class="ident">block_offset</span>,
|
||||
<span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">clone</span>(),
|
||||
<span class="self">self</span>.<span class="ident">block_device</span>.<span class="ident">clone</span>(),
|
||||
))
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
<span class="kw">fn</span> <span class="ident">increase_size</span>(
|
||||
<span class="kw-2">&</span><span class="self">self</span>,
|
||||
<span class="ident">new_size</span>: <span class="ident">u32</span>,
|
||||
<span class="ident">disk_inode</span>: <span class="kw-2">&mut</span> <span class="ident">DiskInode</span>,
|
||||
<span class="ident">fs</span>: <span class="kw-2">&mut</span> <span class="ident">MutexGuard</span><span class="op"><</span><span class="ident">EasyFileSystem</span><span class="op">></span>,
|
||||
) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::increase_size() begin"</span>);
|
||||
<span class="kw">if</span> <span class="ident">new_size</span> <span class="op"><</span> <span class="ident">disk_inode</span>.<span class="ident">size</span> {
|
||||
<span class="kw">return</span>;
|
||||
}
|
||||
<span class="kw">let</span> <span class="ident">blocks_needed</span> <span class="op">=</span> <span class="ident">disk_inode</span>.<span class="ident">blocks_num_needed</span>(<span class="ident">new_size</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">u32</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
<span class="kw">for</span> <span class="kw">_</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">blocks_needed</span> {
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">fs</span>.<span class="ident">alloc_data</span>());
|
||||
}
|
||||
<span class="ident">disk_inode</span>.<span class="ident">increase_size</span>(<span class="ident">new_size</span>, <span class="ident">v</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>);
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">create</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">name</span>: <span class="kw-2">&</span><span class="ident">str</span>) -> <span class="prelude-ty">Option</span><span class="op"><</span><span class="ident">Arc</span><span class="op"><</span><span class="ident">Inode</span><span class="op">></span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::create() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="kw">let</span> <span class="ident">op</span> <span class="op">=</span> <span class="op">|</span><span class="ident">root_inode</span>: <span class="kw-2">&mut</span> <span class="ident">DiskInode</span><span class="op">|</span> {
|
||||
<span class="comment">// assert it is a directory</span>
|
||||
<span class="macro">assert!</span>(<span class="ident">root_inode</span>.<span class="ident">is_dir</span>());
|
||||
<span class="comment">// has the file been created?</span>
|
||||
<span class="self">self</span>.<span class="ident">find_inode_id</span>(<span class="ident">name</span>, <span class="ident">root_inode</span>)
|
||||
};
|
||||
<span class="kw">if</span> <span class="self">self</span>.<span class="ident">modify_disk_inode</span>(<span class="ident">op</span>).<span class="ident">is_some</span>() {
|
||||
<span class="kw">return</span> <span class="prelude-val">None</span>;
|
||||
}
|
||||
<span class="comment">// create a new file</span>
|
||||
<span class="comment">// alloc a inode with an indirect block</span>
|
||||
<span class="kw">let</span> <span class="ident">new_inode_id</span> <span class="op">=</span> <span class="ident">fs</span>.<span class="ident">alloc_inode</span>();
|
||||
<span class="comment">// initialize inode</span>
|
||||
<span class="kw">let</span> (<span class="ident">new_inode_block_id</span>, <span class="ident">new_inode_block_offset</span>) <span class="op">=</span> <span class="ident">fs</span>.<span class="ident">get_disk_inode_pos</span>(<span class="ident">new_inode_id</span>);
|
||||
<span class="ident">get_block_cache</span>(<span class="ident">new_inode_block_id</span> <span class="kw">as</span> <span class="ident">usize</span>, <span class="ident">Arc::clone</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>))
|
||||
.<span class="ident">lock</span>()
|
||||
.<span class="ident">modify</span>(<span class="ident">new_inode_block_offset</span>, <span class="op">|</span><span class="ident">new_inode</span>: <span class="kw-2">&mut</span> <span class="ident">DiskInode</span><span class="op">|</span> {
|
||||
<span class="ident">new_inode</span>.<span class="ident">initialize</span>(<span class="ident">DiskInodeType::File</span>);
|
||||
});
|
||||
<span class="self">self</span>.<span class="ident">modify_disk_inode</span>(<span class="op">|</span><span class="ident">root_inode</span><span class="op">|</span> {
|
||||
<span class="comment">// append file in the dirent</span>
|
||||
<span class="kw">let</span> <span class="ident">file_count</span> <span class="op">=</span> (<span class="ident">root_inode</span>.<span class="ident">size</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="ident">DIRENT_SZ</span>;
|
||||
<span class="kw">let</span> <span class="ident">new_size</span> <span class="op">=</span> (<span class="ident">file_count</span> <span class="op">+</span> <span class="number">1</span>) <span class="op">*</span> <span class="ident">DIRENT_SZ</span>;
|
||||
<span class="comment">// increase size</span>
|
||||
<span class="self">self</span>.<span class="ident">increase_size</span>(<span class="ident">new_size</span> <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">root_inode</span>, <span class="kw-2">&mut</span> <span class="ident">fs</span>);
|
||||
<span class="comment">// write dirent</span>
|
||||
<span class="kw">let</span> <span class="ident">dirent</span> <span class="op">=</span> <span class="ident">DirEntry::new</span>(<span class="ident">name</span>, <span class="ident">new_inode_id</span>);
|
||||
<span class="ident">root_inode</span>.<span class="ident">write_at</span>(
|
||||
<span class="ident">file_count</span> <span class="op">*</span> <span class="ident">DIRENT_SZ</span>,
|
||||
<span class="ident">dirent</span>.<span class="ident">as_bytes</span>(),
|
||||
<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>,
|
||||
);
|
||||
});
|
||||
|
||||
<span class="kw">let</span> (<span class="ident">block_id</span>, <span class="ident">block_offset</span>) <span class="op">=</span> <span class="ident">fs</span>.<span class="ident">get_disk_inode_pos</span>(<span class="ident">new_inode_id</span>);
|
||||
<span class="ident">block_cache_sync_all</span>();
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::create() end"</span>);
|
||||
<span class="comment">// return inode</span>
|
||||
<span class="prelude-val">Some</span>(<span class="ident">Arc::new</span>(<span class="ident"><span class="self">Self</span>::new</span>(
|
||||
<span class="ident">block_id</span>,
|
||||
<span class="ident">block_offset</span>,
|
||||
<span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">clone</span>(),
|
||||
<span class="self">self</span>.<span class="ident">block_device</span>.<span class="ident">clone</span>(),
|
||||
)))
|
||||
<span class="comment">// release efs lock automatically by compiler</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">ls</span>(<span class="kw-2">&</span><span class="self">self</span>) -> <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::ls() begin"</span>);
|
||||
<span class="kw">let</span> <span class="ident">_fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="self">self</span>.<span class="ident">read_disk_inode</span>(<span class="op">|</span><span class="ident">disk_inode</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">file_count</span> <span class="op">=</span> (<span class="ident">disk_inode</span>.<span class="ident">size</span> <span class="kw">as</span> <span class="ident">usize</span>) <span class="op">/</span> <span class="ident">DIRENT_SZ</span>;
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">v</span>: <span class="ident">Vec</span><span class="op"><</span><span class="ident">String</span><span class="op">></span> <span class="op">=</span> <span class="ident">Vec::new</span>();
|
||||
<span class="kw">for</span> <span class="ident">i</span> <span class="kw">in</span> <span class="number">0</span>..<span class="ident">file_count</span> {
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">dirent</span> <span class="op">=</span> <span class="ident">DirEntry::empty</span>();
|
||||
<span class="macro">assert_eq!</span>(
|
||||
<span class="ident">disk_inode</span>.<span class="ident">read_at</span>(<span class="ident">i</span> <span class="op">*</span> <span class="ident">DIRENT_SZ</span>, <span class="ident">dirent</span>.<span class="ident">as_bytes_mut</span>(), <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>,),
|
||||
<span class="ident">DIRENT_SZ</span>,
|
||||
);
|
||||
<span class="ident">v</span>.<span class="ident">push</span>(<span class="ident">String::from</span>(<span class="ident">dirent</span>.<span class="ident">name</span>()));
|
||||
}
|
||||
<span class="ident">v</span>
|
||||
})
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">read_at</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>, <span class="ident">buf</span>: <span class="kw-2">&mut</span> [<span class="ident">u8</span>]) -> <span class="ident">usize</span> {
|
||||
<span class="comment">//kprintln!("[KERN EASYFS] vfs::Inode::read_at() begin");</span>
|
||||
<span class="kw">let</span> <span class="ident">_fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="self">self</span>.<span class="ident">read_disk_inode</span>(<span class="op">|</span><span class="ident">disk_inode</span><span class="op">|</span> <span class="ident">disk_inode</span>.<span class="ident">read_at</span>(<span class="ident">offset</span>, <span class="ident">buf</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>))
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">write_at</span>(<span class="kw-2">&</span><span class="self">self</span>, <span class="ident">offset</span>: <span class="ident">usize</span>, <span class="ident">buf</span>: <span class="kw-2">&</span>[<span class="ident">u8</span>]) -> <span class="ident">usize</span> {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::write_at() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="kw">let</span> <span class="ident">size</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">modify_disk_inode</span>(<span class="op">|</span><span class="ident">disk_inode</span><span class="op">|</span> {
|
||||
<span class="self">self</span>.<span class="ident">increase_size</span>((<span class="ident">offset</span> <span class="op">+</span> <span class="ident">buf</span>.<span class="ident">len</span>()) <span class="kw">as</span> <span class="ident">u32</span>, <span class="ident">disk_inode</span>, <span class="kw-2">&mut</span> <span class="ident">fs</span>);
|
||||
<span class="ident">disk_inode</span>.<span class="ident">write_at</span>(<span class="ident">offset</span>, <span class="ident">buf</span>, <span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>)
|
||||
});
|
||||
<span class="ident">block_cache_sync_all</span>();
|
||||
<span class="ident">size</span>
|
||||
}
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">fn</span> <span class="ident">clear</span>(<span class="kw-2">&</span><span class="self">self</span>) {
|
||||
<span class="macro">kprintln!</span>(<span class="string">"[KERN EASYFS] vfs::Inode::clear() begin"</span>);
|
||||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">fs</span> <span class="op">=</span> <span class="self">self</span>.<span class="ident">fs</span>.<span class="ident">lock</span>();
|
||||
<span class="self">self</span>.<span class="ident">modify_disk_inode</span>(<span class="op">|</span><span class="ident">disk_inode</span><span class="op">|</span> {
|
||||
<span class="kw">let</span> <span class="ident">size</span> <span class="op">=</span> <span class="ident">disk_inode</span>.<span class="ident">size</span>;
|
||||
<span class="kw">let</span> <span class="ident">data_blocks_dealloc</span> <span class="op">=</span> <span class="ident">disk_inode</span>.<span class="ident">clear_size</span>(<span class="kw-2">&</span><span class="self">self</span>.<span class="ident">block_device</span>);
|
||||
<span class="macro">assert!</span>(<span class="ident">data_blocks_dealloc</span>.<span class="ident">len</span>() <span class="op">==</span> <span class="ident">DiskInode::total_blocks</span>(<span class="ident">size</span>) <span class="kw">as</span> <span class="ident">usize</span>);
|
||||
<span class="kw">for</span> <span class="ident">data_block</span> <span class="kw">in</span> <span class="ident">data_blocks_dealloc</span>.<span class="ident">into_iter</span>() {
|
||||
<span class="ident">fs</span>.<span class="ident">dealloc_data</span>(<span class="ident">data_block</span>);
|
||||
}
|
||||
});
|
||||
<span class="ident">block_cache_sync_all</span>();
|
||||
}
|
||||
}
|
||||
</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
@ -152,7 +152,7 @@
|
||||
<span class="kw">use</span> <span class="ident">alloc::sync::Arc</span>;
|
||||
<span class="kw">use</span> <span class="ident">alloc::vec::Vec</span>;
|
||||
<span class="kw">use</span> <span class="ident">bitflags</span>::<span class="kw-2">*</span>;
|
||||
<span class="kw">use</span> <span class="ident">easy_fs</span>::{<span class="ident">EasyFileSystem</span>, <span class="ident">Inode</span>};
|
||||
<span class="kw">use</span> <span class="ident"><span class="kw">super</span>::easy_fs</span>::{<span class="ident">EasyFileSystem</span>, <span class="ident">Inode</span>};
|
||||
<span class="kw">use</span> <span class="ident">lazy_static</span>::<span class="kw-2">*</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">struct</span> <span class="ident">OSInode</span> {
|
||||
|
@ -17,10 +17,11 @@
|
||||
<span id="14">14</span>
|
||||
<span id="15">15</span>
|
||||
<span id="16">16</span>
|
||||
<span id="17">17</span>
|
||||
</pre><pre class="rust"><code><span class="kw">mod</span> <span class="ident">inode</span>;
|
||||
<span class="kw">mod</span> <span class="ident">pipe</span>;
|
||||
<span class="kw">mod</span> <span class="ident">stdio</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">mod</span> <span class="ident">easy_fs</span>;
|
||||
<span class="kw">use</span> <span class="ident"><span class="kw">crate</span>::mm::UserBuffer</span>;
|
||||
|
||||
<span class="kw">pub</span> <span class="kw">trait</span> <span class="ident">File</span>: <span class="ident">Send</span> <span class="op">+</span> <span class="ident">Sync</span> {
|
||||
@ -33,6 +34,6 @@
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">inode</span>::{<span class="ident">list_apps</span>, <span class="ident">open_file</span>, <span class="ident">OSInode</span>, <span class="ident">OpenFlags</span>};
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">pipe</span>::{<span class="ident">make_pipe</span>, <span class="ident">Pipe</span>};
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">stdio</span>::{<span class="ident">Stdin</span>, <span class="ident">Stdout</span>};
|
||||
</code></pre></div>
|
||||
<span class="kw">pub</span> <span class="kw">use</span> <span class="ident">easy_fs</span>::<span class="kw-2">*</span>;</code></pre></div>
|
||||
</section><section id="search" class="content hidden"></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="os" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.60.0-nightly (9ad5d82f8 2022-01-18)" ></div>
|
||||
</body></html>
|
Loading…
Reference in New Issue
Block a user