From 1fbda15575d1e0192163c0b4da9513064c68112a Mon Sep 17 00:00:00 2001 From: WangRunji Date: Wed, 7 Nov 2018 13:10:23 +0800 Subject: [PATCH] remove open() & close() from INode --- src/sfs.rs | 7 ------- src/vfs.rs | 2 -- 2 files changed, 9 deletions(-) diff --git a/src/sfs.rs b/src/sfs.rs index ed7c99e..41bdcf4 100644 --- a/src/sfs.rs +++ b/src/sfs.rs @@ -248,13 +248,6 @@ impl INodeImpl { } impl vfs::INode for INodeImpl { - fn open(&self, _flags: u32) -> vfs::Result<()> { - // Do nothing - Ok(()) - } - fn close(&self) -> vfs::Result<()> { - self.sync() - } fn read_at(&self, offset: usize, buf: &mut [u8]) -> vfs::Result { assert_eq!(self.disk_inode.read().type_, FileType::File, "read_at is only available on file"); self._read_at(offset, buf) diff --git a/src/vfs.rs b/src/vfs.rs index 8dbd6f2..d7965a5 100644 --- a/src/vfs.rs +++ b/src/vfs.rs @@ -11,8 +11,6 @@ pub trait Device: Send { /// Abstract operations on a inode. pub trait INode: Debug + Any + Sync + Send { - fn open(&self, flags: u32) -> Result<()>; - fn close(&self) -> Result<()>; fn read_at(&self, offset: usize, buf: &mut [u8]) -> Result; fn write_at(&self, offset: usize, buf: &[u8]) -> Result; fn info(&self) -> Result;