X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1187511bb7f9942605f779843be0adb52e46c1a7..ac3a4c06f30f861cef2a98f12f5a5d195f922aeb:/src/simix/smx_io.c diff --git a/src/simix/smx_io.c b/src/simix/smx_io.c index 438d87dca7..ee36fa4358 100644 --- a/src/simix/smx_io.c +++ b/src/simix/smx_io.c @@ -33,6 +33,22 @@ smx_storage_t SIMIX_storage_create(const char *name, void *storage, void *data) return xbt_lib_get_or_null(storage_lib, name, SIMIX_STORAGE_LEVEL); } +/** + * \brief Internal function to destroy a SIMIX storage. + * + * \param s the host to destroy (a smx_storage_t) + */ +void SIMIX_storage_destroy(void *s) +{ + smx_storage_priv_t storage = (smx_storage_priv_t) s; + + xbt_assert((storage != NULL), "Invalid parameters"); + if (storage->data) + free(storage->data); + + /* Clean storage structure */ + free(storage); +} void* SIMIX_pre_file_get_data(smx_simcall_t simcall,smx_file_t fd){ return SIMIX_file_get_data(fd); @@ -284,6 +300,16 @@ xbt_dynar_t SIMIX_file_get_info(smx_process_t process, smx_file_t fd) fd->surf_file); } +void SIMIX_pre_storage_file_rename(smx_simcall_t simcall, smx_storage_t storage, const char* src, const char* dest) +{ + return SIMIX_storage_file_rename(simcall->issuer, storage, src, dest); +} + +void SIMIX_storage_file_rename(smx_process_t process, smx_storage_t storage, const char* src, const char* dest) +{ + return surf_storage_model->extension.storage.rename(storage, src, dest); +} + sg_storage_size_t SIMIX_pre_storage_get_free_size(smx_simcall_t simcall, const char* name) { return SIMIX_storage_get_free_size(simcall->issuer, name); @@ -352,6 +378,11 @@ xbt_dict_t SIMIX_storage_get_content(smx_storage_t storage){ return surf_storage_model->extension.storage.get_content(storage); } +sg_storage_size_t SIMIX_storage_get_size(smx_storage_t storage){ + xbt_assert((storage != NULL), "Invalid parameters (simix storage is NULL)"); + return surf_storage_model->extension.storage.get_size(storage); +} + void SIMIX_post_io(smx_action_t action) { xbt_fifo_item_t i;