|
|
@ -4,11 +4,11 @@ use core::mem::uninitialized;
|
|
|
|
use core::slice;
|
|
|
|
use core::slice;
|
|
|
|
use core::fmt::{Debug, Formatter, Error};
|
|
|
|
use core::fmt::{Debug, Formatter, Error};
|
|
|
|
use core::any::Any;
|
|
|
|
use core::any::Any;
|
|
|
|
use dirty::Dirty;
|
|
|
|
|
|
|
|
use structs::*;
|
|
|
|
|
|
|
|
use vfs::{self, Device, INode, FileSystem};
|
|
|
|
|
|
|
|
use util::*;
|
|
|
|
|
|
|
|
use spin::{Mutex, RwLock};
|
|
|
|
use spin::{Mutex, RwLock};
|
|
|
|
|
|
|
|
use crate::dirty::Dirty;
|
|
|
|
|
|
|
|
use crate::structs::*;
|
|
|
|
|
|
|
|
use crate::vfs::{self, Device, INode, FileSystem};
|
|
|
|
|
|
|
|
use crate::util::*;
|
|
|
|
|
|
|
|
|
|
|
|
impl Device {
|
|
|
|
impl Device {
|
|
|
|
fn read_block(&mut self, id: BlockId, offset: usize, buf: &mut [u8]) -> vfs::Result<()> {
|
|
|
|
fn read_block(&mut self, id: BlockId, offset: usize, buf: &mut [u8]) -> vfs::Result<()> {
|
|
|
@ -622,7 +622,7 @@ impl vfs::FileSystem for SimpleFileSystem {
|
|
|
|
impl Drop for SimpleFileSystem {
|
|
|
|
impl Drop for SimpleFileSystem {
|
|
|
|
/// Auto sync when drop
|
|
|
|
/// Auto sync when drop
|
|
|
|
fn drop(&mut self) {
|
|
|
|
fn drop(&mut self) {
|
|
|
|
use vfs::FileSystem;
|
|
|
|
use crate::vfs::FileSystem;
|
|
|
|
self.sync().expect("failed to sync");
|
|
|
|
self.sync().expect("failed to sync");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|