+static void storage_action_state_set(surf_action_t action, e_surf_action_state_t state);
+static surf_action_t storage_action_sleep (void *storage, double duration);
+static surf_action_t storage_action_execute (void *storage, double size);
+
+static surf_action_t storage_action_open(void *storage, const char* path, const char* mode)
+{
+ char *storage_type_id = xbt_lib_get_or_null(
+ storage_lib,
+ ((storage_t)storage)->generic_resource.name,
+ ROUTING_STORAGE_LEVEL);
+ storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, storage_type_id,ROUTING_STORAGE_TYPE_LEVEL);
+ xbt_dict_t content_dict = storage_type->content;
+ content_t content = xbt_dict_get(content_dict,path);
+
+ double size = content->size;
+ XBT_DEBUG("Disk '%s' with type_d '%s'",((storage_t)storage)->generic_resource.name,storage_type_id);
+ XBT_INFO("\tFile '%s' size '%f'",path,size);
+
+ surf_action_t action = storage_action_execute(storage,size);
+ return action;
+}
+
+static surf_action_t storage_action_close(void *storage, surf_file_t fp)
+{
+ return storage_action_sleep(storage,2.0);
+}
+
+static surf_action_t storage_action_read(void *storage, void* ptr, size_t size, size_t nmemb, surf_file_t stream)
+{
+ return storage_action_sleep(storage,3.0);
+}
+
+static surf_action_t storage_action_write(void *storage, const void* ptr, size_t size, size_t nmemb, surf_file_t stream)
+{
+ return storage_action_sleep(storage,4.0);
+}
+
+static surf_action_t storage_action_stat(void *storage, int fd, void* buf)
+{
+ return storage_action_sleep(storage,5.0);
+}
+
+static surf_action_t storage_action_execute (void *storage, double size)
+{
+ surf_action_storage_t action = NULL;
+ storage_t STORAGE = storage;
+
+ XBT_IN("(%s,%g)", surf_resource_name(STORAGE), size);
+ action =
+ surf_action_new(sizeof(s_surf_action_storage_t), size, surf_storage_model,
+ STORAGE->state_current != SURF_RESOURCE_ON);
+
+ GENERIC_LMM_ACTION(action).suspended = 0; /* Should be useless because of the
+ calloc but it seems to help valgrind... */
+
+ GENERIC_LMM_ACTION(action).variable =
+ lmm_variable_new(storage_maxmin_system, action, 1.0, -1.0 , 3);
+
+ lmm_expand(storage_maxmin_system, STORAGE->constraint,
+ GENERIC_LMM_ACTION(action).variable, 1.0);
+ XBT_OUT();
+ return (surf_action_t) action;
+}
+
+static surf_action_t storage_action_sleep (void *storage, double duration)