Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove all references to the dead file_ls function
authorsuter <frederic.suter@cc.in2p3.fr>
Fri, 11 Apr 2014 18:46:02 +0000 (20:46 +0200)
committersuter <frederic.suter@cc.in2p3.fr>
Fri, 11 Apr 2014 18:46:02 +0000 (20:46 +0200)
src/surf/storage_interface.cpp
src/surf/storage_interface.hpp
src/surf/storage_n11.cpp
src/surf/surf_c_bindings.cpp

index 0979285..28de019 100644 (file)
@@ -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;
 }
 
index 9db89ae..61ef3ab 100644 (file)
@@ -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;
 };
 
index bdba8e2..d0bc408 100644 (file)
@@ -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,
index 20931bc..6ee28a1 100644 (file)
@@ -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<StorageActionPtr>(action)->p_file;
 }
-
-xbt_dict_t surf_storage_action_get_ls_dict(surf_action_t action){
-  return static_cast<StorageActionPtr>(action)->p_lsDict;
-}