From: suter Date: Fri, 11 Apr 2014 18:46:02 +0000 (+0200) Subject: remove all references to the dead file_ls function X-Git-Tag: v3_11~120^2~1 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9391af5d58374ddbd6ffd823983fa2198fd6affb remove all references to the dead file_ls function --- diff --git a/src/surf/storage_interface.cpp b/src/surf/storage_interface.cpp index 0979285e57..28de019eb4 100644 --- a/src/surf/storage_interface.cpp +++ b/src/surf/storage_interface.cpp @@ -146,7 +146,6 @@ void Storage::setState(e_surf_resource_state_t state) xbt_dict_t Storage::getContent() { /* For the moment this action has no cost, but in the future we could take in account access latency of the disk */ - /*surf_action_t action = storage_action_execute(storage,0, LS);*/ xbt_dict_t content_dict = xbt_dict_new_homogeneous(NULL); xbt_dict_cursor_t cursor = NULL; @@ -177,14 +176,14 @@ sg_size_t Storage::getUsedSize(){ StorageAction::StorageAction(ModelPtr model, double cost, bool failed, StoragePtr storage, e_surf_action_storage_type_t type) : Action(model, cost, failed) -, m_type(type), p_storage(storage), p_file(NULL), p_lsDict(NULL){ +, m_type(type), p_storage(storage), p_file(NULL){ progress = 0; }; StorageAction::StorageAction(ModelPtr model, double cost, bool failed, lmm_variable_t var, StoragePtr storage, e_surf_action_storage_type_t type) : Action(model, cost, failed, var) - , m_type(type), p_storage(storage), p_file(NULL), p_lsDict(NULL) { + , m_type(type), p_storage(storage), p_file(NULL){ progress = 0; } diff --git a/src/surf/storage_interface.hpp b/src/surf/storage_interface.hpp index 9db89aeb07..61ef3abd8a 100644 --- a/src/surf/storage_interface.hpp +++ b/src/surf/storage_interface.hpp @@ -192,15 +192,6 @@ public: */ virtual StorageActionPtr close(surf_file_t fd)=0; - /** - * @brief List directory contents of a path - * @details [long description] - * - * @param path The path to the directory - * @return The StorageAction corresponding to the ls action - */ - virtual StorageActionPtr ls(const char *path)=0; - /** * @brief Read a file * @@ -268,8 +259,7 @@ typedef enum { WRITE, /**< Write in a file */ STAT, /**< Stat a file */ OPEN, /**< Open a file */ - CLOSE, /**< Close a file */ - LS /**< List directory contents */ + CLOSE /**< Close a file */ } e_surf_action_storage_type_t; /** @ingroup SURF_storage_interface @@ -307,7 +297,6 @@ public: e_surf_action_storage_type_t m_type; StoragePtr p_storage; surf_file_t p_file; - xbt_dict_t p_lsDict; double progress; }; diff --git a/src/surf/storage_n11.cpp b/src/surf/storage_n11.cpp index bdba8e2cba..d0bc4080f0 100644 --- a/src/surf/storage_n11.cpp +++ b/src/surf/storage_n11.cpp @@ -378,51 +378,6 @@ StorageN11::StorageN11(StorageModelPtr model, const char* name, xbt_dict_t prope XBT_DEBUG("Create resource with Bconnection '%f' Bread '%f' Bwrite '%f' and Size '%llu'", bconnection, bread, bwrite, size); } -StorageActionPtr StorageN11::ls(const char* path) -{ - StorageActionPtr action = new StorageN11Action(getModel(), 0, getState() != SURF_RESOURCE_ON, this, LS); - - action->p_lsDict = NULL; - xbt_dict_t ls_dict = xbt_dict_new_homogeneous(xbt_free); - - char* key; - sg_size_t size = 0; - xbt_dict_cursor_t cursor = NULL; - - xbt_dynar_t dyn = NULL; - char* file = NULL; - - // for each file in the storage content - xbt_dict_foreach(p_content,cursor,key,size){ - // Search if file start with the prefix 'path' - if(xbt_str_start_with(key,path)){ - file = &key[strlen(path)]; - - // Split file with '/' - dyn = xbt_str_split(file,"/"); - file = xbt_dynar_get_as(dyn,0,char*); - - // file - if(xbt_dynar_length(dyn) == 1){ - sg_size_t *psize = xbt_new(sg_size_t, 1); - *psize=size; - xbt_dict_set(ls_dict, file, psize, NULL); - } - // Directory - else - { - // if directory does not exist yet in the dictionary - if(!xbt_dict_get_or_null(ls_dict,file)) - xbt_dict_set(ls_dict,file,NULL,NULL); - } - xbt_dynar_free(&dyn); - } - } - - action->p_lsDict = ls_dict; - return action; -} - StorageActionPtr StorageN11::open(const char* mount, const char* path) { XBT_DEBUG("\tOpen file '%s'",path); @@ -519,7 +474,6 @@ StorageN11Action::StorageN11Action(ModelPtr model, double cost, bool failed, Sto case OPEN: case CLOSE: case STAT: - case LS: break; case READ: lmm_expand(model->getMaxminSystem(), storage->p_constraintRead, diff --git a/src/surf/surf_c_bindings.cpp b/src/surf/surf_c_bindings.cpp index 20931bc48a..6ee28a1431 100644 --- a/src/surf/surf_c_bindings.cpp +++ b/src/surf/surf_c_bindings.cpp @@ -557,7 +557,3 @@ double surf_network_action_get_latency_limited(surf_action_t action) { surf_file_t surf_storage_action_get_file(surf_action_t action){ return static_cast(action)->p_file; } - -xbt_dict_t surf_storage_action_get_ls_dict(surf_action_t action){ - return static_cast(action)->p_lsDict; -}