Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
allow to call s4u::Exec->setHost() after its start, to migrate it
[simgrid.git] / src / s4u / s4u_storage.cpp
index 9123343..d8f004a 100644 (file)
@@ -3,10 +3,10 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#include "simgrid/s4u/File.hpp"
 #include "simgrid/s4u/Host.hpp"
 #include "simgrid/s4u/Storage.hpp"
 #include "simgrid/simix.hpp"
+#include "src/plugins/file_system/FileSystem.hpp"
 #include "src/surf/StorageImpl.hpp"
 #include <unordered_map>
 
@@ -17,14 +17,10 @@ template class Extendable<simgrid::s4u::Storage>;
 
 namespace s4u {
 
-std::map<std::string, Storage*>* allStorages()
+void getStorageList(std::map<std::string, Storage*>* whereTo)
 {
-  std::unordered_map<std::string, surf::StorageImpl*>* map = surf::StorageImpl::storagesMap();
-  std::map<std::string, Storage*>* res                     = new std::map<std::string, Storage*>;
-  for (auto const& s : *map)
-    res->insert({s.first, &(s.second->piface_)}); // Convert each entry into its interface
-
-  return res;
+  for (auto const& s : *surf::StorageImpl::storagesMap())
+    whereTo->insert({s.first, &(s.second->piface_)}); // Convert each entry into its interface
 }
 
 Storage* Storage::byName(std::string name)
@@ -55,35 +51,6 @@ Host* Storage::getHost()
   return attached_to_;
 }
 
-sg_size_t Storage::getSizeFree()
-{
-  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
-
-  return pimpl_->getSize() - file_system->getUsedSize();
-}
-
-sg_size_t Storage::getSizeUsed()
-{
-  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
-  return file_system->getUsedSize();
-}
-
-void Storage::decrUsedSize(sg_size_t size)
-{
-  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
-  file_system->decrUsedSize(size);
-}
-
-void Storage::incrUsedSize(sg_size_t size)
-{
-  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
-  file_system->incrUsedSize(size);
-}
-
-sg_size_t Storage::getSize()
-{
-  return pimpl_->getSize();
-}
 
 std::map<std::string, std::string>* Storage::getProperties()
 {
@@ -100,12 +67,6 @@ void Storage::setProperty(std::string key, std::string value)
   simgrid::simix::kernelImmediate([this, key, value] { this->pimpl_->setProperty(key, value); });
 }
 
-std::map<std::string, sg_size_t>* Storage::getContent()
-{
-  FileSystemStorageExt* file_system = extension<FileSystemStorageExt>();
-  return file_system->getContent();
-}
-
 sg_size_t Storage::read(sg_size_t size)
 {
   return simcall_storage_read(pimpl_, size);