diff --git a/examples/jbod.cpp b/examples/jbod.cpp index d2ce568..0afe068 100644 --- a/examples/jbod.cpp +++ b/examples/jbod.cpp @@ -9,7 +9,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(fs_test, "File System Test"); namespace sg4 = simgrid::s4u; -namespace sgfs = simgrid::module::fs; +namespace sgfs = simgrid::fsmod; class FileWriterActor { std::shared_ptr fs_; diff --git a/examples/open_seek_write.cpp b/examples/open_seek_write.cpp index 9ac3fd3..9cf0349 100644 --- a/examples/open_seek_write.cpp +++ b/examples/open_seek_write.cpp @@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(fs_test, "File System Test"); namespace sg4 = simgrid::s4u; -namespace sgfs = simgrid::module::fs; +namespace sgfs = simgrid::fsmod; class FileWriterActor { std::shared_ptr fs_; diff --git a/include/fsmod/File.hpp b/include/fsmod/File.hpp index b46d3ca..79e6369 100644 --- a/include/fsmod/File.hpp +++ b/include/fsmod/File.hpp @@ -10,7 +10,7 @@ #include "FileStat.hpp" #include "Partition.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that implemented a file abstraction @@ -68,7 +68,7 @@ namespace simgrid::module::fs { std::unique_ptr stat() const; }; -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif \ No newline at end of file diff --git a/include/fsmod/FileMetadata.hpp b/include/fsmod/FileMetadata.hpp index 6160c06..1d10610 100644 --- a/include/fsmod/FileMetadata.hpp +++ b/include/fsmod/FileMetadata.hpp @@ -5,7 +5,7 @@ #include #include -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** \cond EXCLUDE_FROM_DOCUMENTATION */ diff --git a/include/fsmod/FileStat.hpp b/include/fsmod/FileStat.hpp index 3b245fb..0ec5c0b 100644 --- a/include/fsmod/FileStat.hpp +++ b/include/fsmod/FileStat.hpp @@ -5,7 +5,7 @@ #include #include -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that implemented a file stat data structure diff --git a/include/fsmod/FileSystem.hpp b/include/fsmod/FileSystem.hpp index fe4d665..089a34e 100644 --- a/include/fsmod/FileSystem.hpp +++ b/include/fsmod/FileSystem.hpp @@ -13,7 +13,7 @@ #include "Partition.hpp" #include "File.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that implements a file system abstraction @@ -59,6 +59,6 @@ namespace simgrid::module::fs { int num_open_files_ = 0; }; -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif diff --git a/include/fsmod/FileSystemException.hpp b/include/fsmod/FileSystemException.hpp index 09ecf26..0a4fe54 100644 --- a/include/fsmod/FileSystemException.hpp +++ b/include/fsmod/FileSystemException.hpp @@ -17,7 +17,7 @@ // } \ // } -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief The exception class for fsmod diff --git a/include/fsmod/JBODStorage.hpp b/include/fsmod/JBODStorage.hpp index 9535b2b..95a1358 100644 --- a/include/fsmod/JBODStorage.hpp +++ b/include/fsmod/JBODStorage.hpp @@ -5,7 +5,7 @@ #include "Storage.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that implements an abstraction of a "Just a Bunch Of Disks" storage diff --git a/include/fsmod/OneDiskStorage.hpp b/include/fsmod/OneDiskStorage.hpp index 88b603e..3ba522b 100644 --- a/include/fsmod/OneDiskStorage.hpp +++ b/include/fsmod/OneDiskStorage.hpp @@ -4,7 +4,7 @@ #include #include "Storage.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that implements a one-disk storage @@ -22,6 +22,6 @@ namespace simgrid::module::fs { OneDiskStorage(const std::string &name, simgrid::s4u::Disk *disk); s4u::MessageQueue *mq_; }; -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif //FSMOD_ONEDISKSTORAGE_HPP diff --git a/include/fsmod/Partition.hpp b/include/fsmod/Partition.hpp index 8f93266..8b84736 100644 --- a/include/fsmod/Partition.hpp +++ b/include/fsmod/Partition.hpp @@ -10,7 +10,7 @@ #include "fsmod/FileMetadata.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { class Storage; @@ -98,6 +98,6 @@ namespace simgrid::module::fs { protected: void delete_file(const std::string& dir_path, const std::string& file_name); }; -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif diff --git a/include/fsmod/PartitionFIFOCaching.hpp b/include/fsmod/PartitionFIFOCaching.hpp index 2821480..7ca8e44 100644 --- a/include/fsmod/PartitionFIFOCaching.hpp +++ b/include/fsmod/PartitionFIFOCaching.hpp @@ -11,7 +11,7 @@ #include "fsmod/Partition.hpp" #include "fsmod/FileMetadata.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** \cond EXCLUDE_FROM_DOCUMENTATION */ @@ -36,6 +36,6 @@ namespace simgrid::module::fs { /** \endcond */ -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif diff --git a/include/fsmod/PartitionLRUCaching.hpp b/include/fsmod/PartitionLRUCaching.hpp index 29c7f31..220012e 100644 --- a/include/fsmod/PartitionLRUCaching.hpp +++ b/include/fsmod/PartitionLRUCaching.hpp @@ -11,7 +11,7 @@ #include "fsmod/PartitionFIFOCaching.hpp" #include "fsmod/FileMetadata.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** \cond EXCLUDE_FROM_DOCUMENTATION */ @@ -29,6 +29,6 @@ namespace simgrid::module::fs { /** \endcond */ -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif diff --git a/include/fsmod/PathUtil.hpp b/include/fsmod/PathUtil.hpp index 47ac120..16830a4 100644 --- a/include/fsmod/PathUtil.hpp +++ b/include/fsmod/PathUtil.hpp @@ -8,7 +8,7 @@ #include "Partition.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** \cond EXCLUDE_FROM_DOCUMENTATION */ @@ -23,6 +23,6 @@ namespace simgrid::module::fs { /** \endcond */ -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif \ No newline at end of file diff --git a/include/fsmod/Storage.hpp b/include/fsmod/Storage.hpp index 4c50da8..88d691b 100644 --- a/include/fsmod/Storage.hpp +++ b/include/fsmod/Storage.hpp @@ -9,7 +9,7 @@ #include "Partition.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A class that iplements a storage abstraction @@ -36,6 +36,6 @@ namespace simgrid::module::fs { virtual void write(sg_size_t size) = 0; }; -} // namespace simgrid::module::fs +} // namespace simgrid::fsmod #endif diff --git a/src/File.cpp b/src/File.cpp index a681548..c4fd8f7 100644 --- a/src/File.cpp +++ b/src/File.cpp @@ -10,7 +10,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(fsmod_file, "File System module: File management related logs"); -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief Asynchronously read data from the file diff --git a/src/FileMetadata.cpp b/src/FileMetadata.cpp index 2c638bc..bfe5ff8 100644 --- a/src/FileMetadata.cpp +++ b/src/FileMetadata.cpp @@ -5,26 +5,25 @@ #include "fsmod/FileMetadata.hpp" #include "fsmod/FileSystemException.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { - FileMetadata::FileMetadata(sg_size_t initial_size, simgrid::module::fs::Partition *partition, std::string dir_path, - std::string file_name) + FileMetadata::FileMetadata(sg_size_t initial_size, Partition *partition, std::string dir_path, std::string file_name) : current_size_(initial_size), future_size_(initial_size), partition_(partition), dir_path_(std::move(dir_path)), file_name_(std::move(file_name)) { - creation_date_ = s4u::Engine::get_clock(); - partition_->new_file_creation_event(this); + creation_date_ = s4u::Engine::get_clock(); + partition_->new_file_creation_event(this); - access_date_ = s4u::Engine::get_clock(); - partition_->new_file_access_event(this); + access_date_ = s4u::Engine::get_clock(); + partition_->new_file_access_event(this); - modification_date_ = s4u::Engine::get_clock(); + modification_date_ = s4u::Engine::get_clock(); } - void FileMetadata::set_access_date(double date) { - access_date_ = date; - partition_->new_file_access_event(this); + void FileMetadata::set_access_date(double date) { + access_date_ = date; + partition_->new_file_access_event(this); } -} // namespace simgrid::module::fs \ No newline at end of file +} // namespace simgrid::fsmod \ No newline at end of file diff --git a/src/FileSystem.cpp b/src/FileSystem.cpp index afd4e09..b649f26 100644 --- a/src/FileSystem.cpp +++ b/src/FileSystem.cpp @@ -13,7 +13,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(fsmod_filesystem, "File System module: File system management related logs"); -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief Private method to find the partition and path at mount point for an absolute path diff --git a/src/JBODStorage.cpp b/src/JBODStorage.cpp index 341e3a5..726e362 100644 --- a/src/JBODStorage.cpp +++ b/src/JBODStorage.cpp @@ -6,7 +6,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(fsmod_jbod, "File System module: JBOD Storage related logs"); -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief Method to create an instance of a JBOD (Just a Bunch of Disks) storage diff --git a/src/OneDiskStorage.cpp b/src/OneDiskStorage.cpp index 8a96c70..f6eaea3 100644 --- a/src/OneDiskStorage.cpp +++ b/src/OneDiskStorage.cpp @@ -1,7 +1,7 @@ #include "fsmod/OneDiskStorage.hpp" #include -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief Method to create an instance of a one-disk storage diff --git a/src/Partition.cpp b/src/Partition.cpp index c88c351..5c4bfa8 100644 --- a/src/Partition.cpp +++ b/src/Partition.cpp @@ -4,7 +4,7 @@ #include "fsmod/FileMetadata.hpp" #include "fsmod/FileSystemException.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { Partition::Partition(std::string name, std::shared_ptr storage, sg_size_t size) diff --git a/src/PartitionFIFOCaching.cpp b/src/PartitionFIFOCaching.cpp index ee876d5..852ef39 100644 --- a/src/PartitionFIFOCaching.cpp +++ b/src/PartitionFIFOCaching.cpp @@ -4,7 +4,7 @@ #include "fsmod/PartitionFIFOCaching.hpp" #include "fsmod/FileSystemException.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { void PartitionFIFOCaching::create_space(sg_size_t num_bytes) { sg_size_t space_that_can_be_created = 0.0; diff --git a/src/PartitionLRUCaching.cpp b/src/PartitionLRUCaching.cpp index e19059c..05cace0 100644 --- a/src/PartitionLRUCaching.cpp +++ b/src/PartitionLRUCaching.cpp @@ -1,6 +1,6 @@ #include "fsmod/PartitionLRUCaching.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { void PartitionLRUCaching::new_file_access_event(FileMetadata *file_metadata) { priority_list_.erase(file_metadata->sequence_number_); diff --git a/src/PathUtil.cpp b/src/PathUtil.cpp index 003d92c..1e7c13c 100644 --- a/src/PathUtil.cpp +++ b/src/PathUtil.cpp @@ -4,7 +4,7 @@ #include #include "fsmod/PathUtil.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { /** * @brief A method to simplify a path string (which is either absolute or relative to /) diff --git a/src/Storage.cpp b/src/Storage.cpp index a00673a..6082742 100644 --- a/src/Storage.cpp +++ b/src/Storage.cpp @@ -1,6 +1,6 @@ #include "fsmod/Storage.hpp" -namespace simgrid::module::fs { +namespace simgrid::fsmod { } diff --git a/test/caching_test.cpp b/test/caching_test.cpp index ab3682e..cb9448c 100644 --- a/test/caching_test.cpp +++ b/test/caching_test.cpp @@ -10,7 +10,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(fifo_caching_test, "FIFO Caching Test"); diff --git a/test/file_system_test.cpp b/test/file_system_test.cpp index 53f850f..8de7c74 100644 --- a/test/file_system_test.cpp +++ b/test/file_system_test.cpp @@ -10,7 +10,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(fs_test, "File System Test"); diff --git a/test/jbod_storage_test.cpp b/test/jbod_storage_test.cpp index 9c29156..ec68948 100644 --- a/test/jbod_storage_test.cpp +++ b/test/jbod_storage_test.cpp @@ -11,7 +11,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(jds_io_test, "JBODStorage I/O Test"); diff --git a/test/one_disk_storage_test.cpp b/test/one_disk_storage_test.cpp index fef4d1b..7672820 100644 --- a/test/one_disk_storage_test.cpp +++ b/test/one_disk_storage_test.cpp @@ -11,7 +11,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(ods_io_test, "OneDiskStorage I/O Test"); diff --git a/test/path_util_test.cpp b/test/path_util_test.cpp index 736e3b4..a0af081 100644 --- a/test/path_util_test.cpp +++ b/test/path_util_test.cpp @@ -2,7 +2,7 @@ #include #include "fsmod/PathUtil.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; // Ugly macro, but useful for these specific tests for knowing what's happening #define MY_ASSERT_EQ(lhs, rhs, message) if ((lhs) != (rhs)) ASSERT_EQ((lhs), (rhs)) \ @@ -67,9 +67,9 @@ TEST_F(PathUtilTest, PathAtMountPoint) { for (const auto &test_item: input_output) { auto [path, mp, output] = test_item; - auto simplified_path = simgrid::module::fs::PathUtil::simplify_path_string(path); + auto simplified_path = sgfs::PathUtil::simplify_path_string(path); try { - auto path_at_mp = simgrid::module::fs::PathUtil::path_at_mount_point(simplified_path, "/dev/a"); + auto path_at_mp = sgfs::PathUtil::path_at_mount_point(simplified_path, "/dev/a"); MY_ASSERT_EQ(output, path_at_mp, "{" + path + ", " + mp + "}"); } catch (std::logic_error &e) { MY_ASSERT_EQ(output, "Exception", "{" + path + ", " + mp + "}"); diff --git a/test/seek_test.cpp b/test/seek_test.cpp index f94451a..3303e83 100644 --- a/test/seek_test.cpp +++ b/test/seek_test.cpp @@ -10,7 +10,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(seek_test, "Seek Test"); diff --git a/test/stat_test.cpp b/test/stat_test.cpp index 2bea7e6..3294311 100644 --- a/test/stat_test.cpp +++ b/test/stat_test.cpp @@ -10,7 +10,7 @@ #include "./test_util.hpp" -namespace sgfs=simgrid::module::fs; +namespace sgfs=simgrid::fsmod; namespace sg4=simgrid::s4u; XBT_LOG_NEW_DEFAULT_CATEGORY(stat_test, "Stat Test"); @@ -50,7 +50,7 @@ TEST_F(StatTest, Stat) { XBT_INFO("Open File '/dev/a/foo.txt'"); ASSERT_NO_THROW(file = fs_->open("/dev/a/foo.txt", "r")); XBT_INFO("Calling stat()"); - std::unique_ptr stat_struct; + std::unique_ptr stat_struct; ASSERT_NO_THROW(stat_struct = file->stat()); XBT_INFO("Checking sanity"); ASSERT_EQ(stat_struct->size_in_bytes, 100*1000);