return action;
}
-static surf_action_t storage_action_unlink(void *storage, surf_file_t fd)
-{
- surf_action_t action = storage_action_execute(storage,0, UNLINK);
-
- // Add memory to storage
- ((storage_t)storage)->used_size -= fd->size;
-
- // Remove the file from storage
- xbt_dict_t content_dict = ((storage_t)storage)->content;
- xbt_dict_remove(content_dict,fd->name);
-
- free(fd->name);
- xbt_free(fd);
-
- return action;
-}
-
static surf_action_t storage_action_open(void *storage, const char* mount,
const char* path)
{
surf_file_t file = xbt_new0(s_surf_file_t,1);
file->name = xbt_strdup(path);
file->size = size;
- file->storage = mount;
+ file->storage = xbt_strdup(mount);
surf_action_t action = storage_action_execute(storage,0, OPEN);
action->file = (void *)file;
}
free(fd->name);
+ free(fd->storage);
xbt_free(fd);
surf_action_t action = storage_action_execute(storage,0, CLOSE);
return action;
case OPEN:
case CLOSE:
case STAT:
- case UNLINK:
case LS:
break;
case READ:
surf_storage_model->extension.storage.close = storage_action_close;
surf_storage_model->extension.storage.read = storage_action_read;
surf_storage_model->extension.storage.write = storage_action_write;
- surf_storage_model->extension.storage.unlink = storage_action_unlink;
surf_storage_model->extension.storage.ls = storage_action_ls;
if (!storage_maxmin_system) {