MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / alloc_inode

Method alloc_inode

atomic-core/src/pristine/txn/write/mod.rs:2130–2142  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

2128 }
2129
2130 fn alloc_inode(&mut self) -> PristineResult<Inode> {
2131 if let Some((_, next, _)) = &mut self.preview_allocations {
2132 let inode = (*next).max(1);
2133 *next = inode
2134 .checked_add(1)
2135 .ok_or(PristineError::IdSpaceExhausted)?;
2136 return Ok(Inode::new(inode));
2137 }
2138 match self.pending_next_inode.as_mut() {
2139 Some(pending) => pending.allocate(),
2140 None => allocate_shared_inode(self.next_inode),
2141 }
2142 }
2143
2144 fn put_directory(&mut self, inode: Inode, flags: u8) -> PristineResult<()> {
2145 let mut table = self.txn.open_table(DIRECTORIES)?;

Calls 2

allocate_shared_inodeFunction · 0.85
allocateMethod · 0.80