-StorageAction *StorageN11::open(const char* mount, const char* path)
-{
- XBT_DEBUG("\tOpen file '%s'",path);
-
- sg_size_t size;
- // if file does not exist create an empty file
- if (content_->find(path) != content_->end())
- size = content_->at(path);
- else {
- size = 0;
- content_->insert({path, size});
- XBT_DEBUG("File '%s' was not found, file created.",path);
- }
- FileImpl* file = new FileImpl(path, mount, size);
-
- StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, OPEN);
- action->file_ = file;
-
- return action;
-}
-
-StorageAction *StorageN11::close(surf_file_t fd)
-{
- XBT_DEBUG("\tClose file '%s' size '%llu'", fd->cname(), fd->size());
- // unref write actions from storage
- for (std::vector<StorageAction*>::iterator it = writeActions_.begin(); it != writeActions_.end();) {
- StorageAction *write_action = *it;
- if ((write_action->file_) == fd) {
- write_action->unref();
- it = writeActions_.erase(it);
- } else {
- ++it;
- }
- }
- StorageAction* action = new StorageN11Action(model(), 0, isOff(), this, CLOSE);
- return action;
-}
-
-StorageAction *StorageN11::read(surf_file_t fd, sg_size_t size)