- if (local_storage_) {
- XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu' '%llu:%llu'", get_path(), local_storage_->get_cname(), size,
- size_, sg_storage_get_size_used(local_storage_), sg_storage_get_size(local_storage_));
- // If the storage is full before even starting to write
- if (sg_storage_get_size_used(local_storage_) >= sg_storage_get_size(local_storage_))
- return 0;
- if (write_inside == 0) {
- /* Subtract the part of the file that might disappear from the used sized on the storage element */
- local_storage_->extension<FileSystemStorageExt>()->decr_used_size(size_ - current_position_);
- write_size = local_storage_->write(size);
- local_storage_->extension<FileSystemStorageExt>()->incr_used_size(write_size);
- current_position_ += write_size;
- size_ = current_position_;
- } else {
- write_size = local_storage_->write(size);
- current_position_ += write_size;
- if (current_position_ > size_)
- size_ = current_position_;
- }
- std::map<std::string, sg_size_t>* content = local_storage_->extension<FileSystemStorageExt>()->get_content();
-
- content->erase(path_);
- content->insert({path_, size_});
- }
-
- if (local_disk_) {
- XBT_DEBUG("WRITE %s on disk '%s'. size '%llu/%llu' '%llu:%llu'", get_path(), local_disk_->get_cname(), size, size_,
- sg_disk_get_size_used(local_disk_), sg_disk_get_size(local_disk_));
- // If the storage is full before even starting to write
- if (sg_disk_get_size_used(local_disk_) >= sg_disk_get_size(local_disk_))
- return 0;
- if (write_inside == 0) {
- /* Subtract the part of the file that might disappear from the used sized on the storage element */
- local_disk_->extension<FileSystemDiskExt>()->decr_used_size(size_ - current_position_);
- write_size = local_disk_->write(size);
- local_disk_->extension<FileSystemDiskExt>()->incr_used_size(write_size);
- current_position_ += write_size;
- size_ = current_position_;
- } else {
- write_size = local_disk_->write(size);
- current_position_ += write_size;
- if (current_position_ > size_)
- size_ = current_position_;
- }
- std::map<std::string, sg_size_t>* content = local_disk_->extension<FileSystemDiskExt>()->get_content();
-
- content->erase(path_);
- content->insert({path_, size_});
- }