#include <fstream>
#include <numeric>
-XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_file, "S4U files");
+XBT_LOG_NEW_DEFAULT_SUBCATEGORY(s4u_file, s4u, "S4U files");
int sg_storage_max_file_descriptors = 1024;
namespace simgrid {
simgrid::xbt::Extension<Storage, FileSystemStorageExt> FileSystemStorageExt::EXTENSION_ID;
simgrid::xbt::Extension<Host, FileDescriptorHostExt> FileDescriptorHostExt::EXTENSION_ID;
-File::File(const std::string& fullpath, void* userdata) : File(fullpath, Host::current(), userdata){};
+File::File(const std::string& fullpath, void* userdata) : File(fullpath, Host::current(), userdata){}
-File::File(const std::string& fullpath, sg_host_t host, void* userdata) : fullpath_(fullpath), userdata_(userdata)
+File::File(const std::string& fullpath, sg_host_t host, void* userdata) : fullpath_(fullpath)
{
+ this->set_data(userdata);
// this cannot fail because we get a xbt_die if the mountpoint does not exist
if (not host->get_mounted_storages().empty()) {
Storage* st = nullptr;
local_disk_->extension<FileSystemDiskExt>()->decr_used_size(size_);
// Remove the file from storage
- content->erase(fullpath_);
+ content->erase(path_);
return 0;
}
void* sg_file_get_data(sg_file_t fd)
{
- return fd->get_userdata();
+ return fd->get_data();
}
void sg_file_set_data(sg_file_t fd, void* data)
{
- fd->set_userdata(data);
+ fd->set_data(data);
}
/**