"\t\tStorage Id: '%s'\n"
"\t\tStorage Type: '%s'\n"
"\t\tFile Descriptor Id: %d",
- fd->getPath(), fd->size(), fd->mount_point.c_str(), fd->storageId.c_str(), fd->storage_type.c_str(),
+ fd->getPath(), fd->size(), fd->mount_point.c_str(), fd->onStorage->getCname(), fd->onStorage->getType(),
fd->desc_id);
}
return 0;
/* Find the host where the file is physically located and read it */
- msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
+ msg_storage_t storage_src = fd->onStorage;
msg_host_t attached_host = storage_src->getHost();
read_size = fd->read(size);
return 0;
/* Find the host where the file is physically located (remote or local)*/
- msg_storage_t storage_src = simgrid::s4u::Storage::byName(fd->storageId);
+ msg_storage_t storage_src = fd->onStorage;
msg_host_t attached_host = storage_src->getHost();
if (strcmp(attached_host->getCname(), MSG_host_self()->getCname())) {
msg_error_t MSG_file_rcopy (msg_file_t file, msg_host_t host, const char* fullpath)
{
/* Find the host where the file is physically located and read it */
- msg_storage_t storage_src = simgrid::s4u::Storage::byName(file->storageId);
+ msg_storage_t storage_src = file->onStorage;
msg_host_t src_host = storage_src->getHost();
MSG_file_seek(file, 0, SEEK_SET);
sg_size_t read_size = file->read(file->size());
const char* MSG_storage_get_name(msg_storage_t storage)
{
xbt_assert((storage != nullptr), "Invalid parameters");
- return storage->getName();
+ return storage->getCname();
}
/** \ingroup msg_storage_management
xbt_dict_t MSG_storage_get_content(msg_storage_t storage)
{
std::map<std::string, sg_size_t>* content = storage->getContent();
- xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(xbt_free_f);
+ // Note: ::operator delete is ok here (no destructor called) since the dict elements are of POD type sg_size_t.
+ xbt_dict_t content_as_dict = xbt_dict_new_homogeneous(::operator delete);
for (auto const& entry : *content) {
- sg_size_t* psize = static_cast<sg_size_t*>(malloc(sizeof(sg_size_t)));
+ sg_size_t* psize = new sg_size_t;
*psize = entry.second;
xbt_dict_set(content_as_dict, entry.first.c_str(), psize, nullptr);
}