Skip to content

Commit 1e2e83e

Browse files
committed
Remove unused code.
1 parent dd2be93 commit 1e2e83e

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

easy-fs/src/layout.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ type IndirectBlock = [u32; BLOCK_SZ / 4];
7272
type DataBlock = [u8; BLOCK_SZ];
7373

7474
#[repr(C)]
75-
/// Only support level-1 indirect now, **indirect2** field is always 0.
7675
pub struct DiskInode {
7776
pub size: u32,
7877
pub direct: [u32; INODE_DIRECT_COUNT],
@@ -235,32 +234,6 @@ impl DiskInode {
235234
}
236235
});
237236
}
238-
239-
/*
240-
pub fn clear_size(&mut self, block_device: &Arc<dyn BlockDevice>) -> Vec<u32> {
241-
let mut v: Vec<u32> = Vec::new();
242-
let blocks = self.blocks() as usize;
243-
self.size = 0;
244-
for i in 0..blocks.min(INODE_DIRECT_COUNT) {
245-
v.push(self.direct[i]);
246-
self.direct[i] = 0;
247-
}
248-
if blocks > INODE_DIRECT_COUNT {
249-
get_block_cache(
250-
self.indirect1 as usize,
251-
Arc::clone(block_device),
252-
)
253-
.lock()
254-
.modify(0, |indirect_block: &mut IndirectBlock| {
255-
for i in 0..blocks - INODE_DIRECT_COUNT {
256-
v.push(indirect_block[i]);
257-
indirect_block[i] = 0;
258-
}
259-
});
260-
}
261-
v
262-
}
263-
*/
264237

265238
/// Clear size to zero and return blocks that should be deallocated.
266239
///

0 commit comments

Comments
 (0)