提交 1e2e83e8 编写于 作者: Y Yifan Wu

Remove unused code.

上级 dd2be93e
......@@ -72,7 +72,6 @@ type IndirectBlock = [u32; BLOCK_SZ / 4];
type DataBlock = [u8; BLOCK_SZ];
#[repr(C)]
/// Only support level-1 indirect now, **indirect2** field is always 0.
pub struct DiskInode {
pub size: u32,
pub direct: [u32; INODE_DIRECT_COUNT],
......@@ -235,32 +234,6 @@ impl DiskInode {
}
});
}
/*
pub fn clear_size(&mut self, block_device: &Arc<dyn BlockDevice>) -> Vec<u32> {
let mut v: Vec<u32> = Vec::new();
let blocks = self.blocks() as usize;
self.size = 0;
for i in 0..blocks.min(INODE_DIRECT_COUNT) {
v.push(self.direct[i]);
self.direct[i] = 0;
}
if blocks > INODE_DIRECT_COUNT {
get_block_cache(
self.indirect1 as usize,
Arc::clone(block_device),
)
.lock()
.modify(0, |indirect_block: &mut IndirectBlock| {
for i in 0..blocks - INODE_DIRECT_COUNT {
v.push(indirect_block[i]);
indirect_block[i] = 0;
}
});
}
v
}
*/
/// Clear size to zero and return blocks that should be deallocated.
///
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册