| 2256 | } |
| 2257 | |
| 2258 | fn commit(self) -> PristineResult<()> { |
| 2259 | if self.preview_allocations.is_some() { |
| 2260 | return Err(PristineError::Inconsistent { |
| 2261 | message: "abort-only preview transaction cannot commit".into(), |
| 2262 | }); |
| 2263 | } |
| 2264 | let pending_next_inode = self.pending_next_inode; |
| 2265 | let shared_next_inode = self.next_inode; |
| 2266 | self.txn.commit()?; |
| 2267 | if let Some(pending) = pending_next_inode { |
| 2268 | pending.publish(shared_next_inode); |
| 2269 | } |
| 2270 | Ok(()) |
| 2271 | } |
| 2272 | |
| 2273 | fn abort(self) -> PristineResult<()> { |
| 2274 | self.txn.abort()?; |