Skip to content

Commit

Permalink
Update origin links on removal
Browse files Browse the repository at this point in the history
Signed-off-by: mulhern <[email protected]>
  • Loading branch information
mulkieran committed Dec 21, 2023
1 parent 5eb48e2 commit fd9f226
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/engine/strat_engine/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,12 @@ impl Pool for StratPool {
}
}

for (_, _, fs) in self.thin_pool.filesystems_mut() {
if fs.origin().map(|x| removed.contains(&x)).unwrap_or(false) {
fs.unset_origin();
}
}

Ok(SetDeleteAction::new(removed))
}

Expand Down
4 changes: 4 additions & 0 deletions src/engine/strat_engine/thinpool/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ impl StratFilesystem {
pub fn thindev_size(&self) -> Sectors {
self.thin_dev.size()
}

pub fn unset_origin(&mut self) {
self.origin = None;
}
}

impl Filesystem for StratFilesystem {
Expand Down

0 comments on commit fd9f226

Please sign in to comment.