MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / alloc_data

Method alloc_data

easy-fs/src/efs.rs:130–132  ·  view source on GitHub ↗

Return a block ID not ID in the data area.

(&mut self)

Source from the content-addressed store, hash-verified

128
129 /// Return a block ID not ID in the data area.
130 pub fn alloc_data(&mut self) -> u32 {
131 self.data_bitmap.alloc(&self.block_device).unwrap() as u32 + self.data_area_start_block
132 }
133
134 pub fn dealloc_data(&mut self, block_id: u32) {
135 get_block_cache(block_id as usize, Arc::clone(&self.block_device))

Callers 1

increase_sizeMethod · 0.80

Calls 1

allocMethod · 0.45

Tested by

no test coverage detected