Skip to content

Commit

Permalink
tmp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
henricasanova committed Oct 5, 2024
1 parent 9235166 commit 988eb91
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,16 @@ namespace simgrid::fsmod {
throw DirectoryDoesNotExistException(XBT_THROW_POINT, dir_path);
}
// Check that no file is open
sg_size_t freed_space = 0;
for (const auto &[filename, metadata]: content_.at(dir_path)) {
if (metadata->get_file_refcount() != 0) {
throw FileIsOpenException(XBT_THROW_POINT, "No content deleted in directory before file " + filename + " is open");
}
freed_space += metadata->get_current_size();
}
// Wipe everything out
// Wipe everything out and update free space!
content_.erase(dir_path);
this->increase_free_space(freed_space);
}

void Partition::truncate_file(const std::string &dir_path, const std::string &file_name, sg_size_t num_bytes) {
Expand Down

0 comments on commit 988eb91

Please sign in to comment.