Skip to content

Commit

Permalink
fix sonar issues
Browse files Browse the repository at this point in the history
  • Loading branch information
frs69wq committed Oct 15, 2024
1 parent 5c7716e commit c448548
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
2 changes: 1 addition & 1 deletion include/fsmod/Partition.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace simgrid::fsmod {
protected:
friend class FileSystem;
// Methods to perform caching
void make_file_evictable(const std::string &dir_path, const std::string &file_name, bool evictable);
void make_file_evictable(const std::string &dir_path, const std::string &file_name, bool evictable) const;
virtual void create_space(sg_size_t num_bytes);
virtual void new_file_creation_event(FileMetadata *file_metadata);
virtual void new_file_access_event(FileMetadata *file_metadata);
Expand Down
1 change: 0 additions & 1 deletion include/fsmod/PartitionFIFOCaching.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ namespace simgrid::fsmod {
private:
unsigned long sequence_number_ = 0;
std::map<unsigned long, FileMetadata*> priority_list_;
// void print_priority_list();
};

/** \endcond */
Expand Down
5 changes: 3 additions & 2 deletions src/Partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace simgrid::fsmod {
}
return to_return;
}

/**
* @brief Retrieve the metadata for a file
* @param dir_path: the path to the directory in which the file is located
Expand Down Expand Up @@ -223,7 +223,8 @@ namespace simgrid::fsmod {
this->increase_free_space(num_bytes);
}

void Partition::make_file_evictable(const std::string &dir_path, const std::string &file_name, bool evictable) {
void Partition::make_file_evictable(const std::string &dir_path, const std::string &file_name,
bool evictable) const {
auto metadata = this->get_file_metadata(dir_path, file_name);
if (not metadata) {
throw FileNotFoundException(XBT_THROW_POINT, dir_path + "/" + file_name);
Expand Down
8 changes: 0 additions & 8 deletions src/PartitionFIFOCaching.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,6 @@ namespace simgrid::fsmod {
}
}

// void PartitionFIFOCaching::print_priority_list() {
// std::cerr << "PLIST " << this->get_name() << " = ";
// for (auto const &i : priority_list_) {
// std::cerr << " " << i.second->file_name_ << " ";
// }
// std::cerr << "\n";
// }

void PartitionFIFOCaching::new_file_creation_event(FileMetadata *file_metadata) {
file_metadata->sequence_number_ = sequence_number_++;
priority_list_[file_metadata->sequence_number_] = file_metadata;
Expand Down

0 comments on commit c448548

Please sign in to comment.