(&mut self)
| 54 | } |
| 55 | |
| 56 | fn allocate(&mut self) -> PristineResult<Inode> { |
| 57 | let inode = self.next.max(1); |
| 58 | self.next = inode |
| 59 | .checked_add(1) |
| 60 | .ok_or(PristineError::IdSpaceExhausted)?; |
| 61 | Ok(Inode::new(inode)) |
| 62 | } |
| 63 | |
| 64 | fn publish(self, shared: &AtomicU64) -> bool { |
| 65 | match shared.compare_exchange(self.expected, self.next, Ordering::SeqCst, Ordering::SeqCst) |