Mark a directory as empty (no children). This is called when the last file is removed from a tracked directory. # Arguments `txn` - A mutable transaction `inode` - The directory's inode
(
txn: &mut T,
inode: Inode,
)
| 730 | /// * `txn` - A mutable transaction |
| 731 | /// * `inode` - The directory's inode |
| 732 | pub fn mark_directory_empty<T: MutTxnT + TreeTxnT>( |
| 733 | txn: &mut T, |
| 734 | inode: Inode, |
| 735 | ) -> TrackingResult<()> { |
| 736 | if txn |
| 737 | .get_directory_flags(inode) |
| 738 | .map_err(|e| TrackingError::Database(e.to_string()))? |
| 739 | .is_some() |
| 740 | { |
| 741 | TreeProjectionPlan::plan( |
| 742 | txn, |
| 743 | [TreeProjectionOperation::DirectoryOccupancy { inode, empty: true }], |
| 744 | )? |
| 745 | .apply(txn)?; |
| 746 | } |
| 747 | Ok(()) |
| 748 | } |
| 749 | |
| 750 | /// Classify a tracked inode by the state that tracking itself owns for it. |
| 751 | /// |
nothing calls this directly
no test coverage detected