From: Pierre Veyre Date: Wed, 18 Sep 2013 12:22:46 +0000 (+0200) Subject: Fix MSG_storage_get_properties() X-Git-Tag: v3_9_90~122 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/78039abf1a93b76364948703c6190980ac03913b Fix MSG_storage_get_properties() --- diff --git a/src/msg/msg_io.c b/src/msg/msg_io.c index 10a6d6778b..d69d7628c5 100644 --- a/src/msg/msg_io.c +++ b/src/msg/msg_io.c @@ -213,16 +213,6 @@ const char *MSG_storage_get_name(msg_storage_t storage) { return SIMIX_storage_get_name(storage); } -/** \ingroup msg_storage_management - * \brief Finds a msg_storage_t using its name. - * \param name the name of a storage. - * \return the corresponding storage - */ -msg_host_t MSG_get_storage_by_name(const char *name) -{ - return (msg_storage_t) xbt_lib_get_elm_or_null(storage_lib,name); -} - /** \ingroup msg_storage_management * \brief Returns the free space size of a storage element * \param the storage name (#char*) @@ -296,11 +286,9 @@ msg_error_t MSG_storage_set_data(msg_storage_t storage, void *data) return MSG_OK; } - - /** \ingroup msg_host_management * - * \brief Return the user data of a #msg_storage_t. + * \brief Returns the user data of a #msg_storage_t. * * This functions checks whether \a storage is a valid pointer or not and return the user data associated to \a storage if it is possible. @@ -310,11 +298,3 @@ void *MSG_storage_get_data(msg_storage_t storage) return SIMIX_storage_get_data(storage); } - - - - - - - - diff --git a/src/surf/storage.c b/src/surf/storage.c index 8584505f7f..e00a72151d 100644 --- a/src/surf/storage.c +++ b/src/surf/storage.c @@ -194,18 +194,18 @@ static surf_action_t storage_action_execute (void *storage, size_t size, e_surf_ static xbt_dict_t storage_get_properties(const void *storage) { - return surf_resource_properties(storage); + return surf_resource_properties(surf_storage_resource_priv(storage)); } static void* storage_create_resource(const char* id, const char* model, - const char* type_id, const char* content_name, const char* content_type){ + const char* type_id, const char* content_name, const char* content_type, xbt_dict_t properties){ storage_t storage = NULL; xbt_assert(!surf_storage_resource_priv(surf_storage_resource_by_name(id)), "Storage '%s' declared several times in the platform file", id); storage = (storage_t) surf_resource_new(sizeof(s_storage_t), - surf_storage_model, id,NULL); + surf_storage_model, id, properties); storage->generic_resource.name = xbt_strdup(id); storage->state_current = SURF_RESOURCE_ON; @@ -213,7 +213,6 @@ static void* storage_create_resource(const char* id, const char* model, storage->size = 0; storage->write_actions = xbt_dynar_new(sizeof(char *),NULL); - storage_type_t storage_type = xbt_lib_get_or_null(storage_type_lib, type_id,ROUTING_STORAGE_TYPE_LEVEL); double Bread = surf_parse_get_bandwidth(xbt_dict_get(storage_type->properties,"Bread")); @@ -445,7 +444,8 @@ static void parse_storage_init(sg_platf_storage_cbarg_t storage) ((storage_type_t) stype)->model, ((storage_type_t) stype)->type_id, storage->content, - storage->content_type); + storage->content_type, + storage->properties); } static void parse_mstorage_init(sg_platf_mstorage_cbarg_t mstorage)